mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
text/v2: bug fix: the offset should be added at the end of each iteration
Updates #2454 Updates #2528
This commit is contained in:
parent
b05c272499
commit
77f3b57d1f
@ -225,12 +225,13 @@ func CacheGlyphs(text string, face Face) {
|
||||
var buf []Glyph
|
||||
// Create all the possible variations (#2528).
|
||||
for i := 0; i < 4; i++ {
|
||||
buf = AppendGlyphs(buf, text, face, x, y)
|
||||
buf = buf[:0]
|
||||
|
||||
if face.direction().isHorizontal() {
|
||||
x += 1.0 / glyphVariationCount
|
||||
} else {
|
||||
y += 1.0 / glyphVariationCount
|
||||
}
|
||||
buf = AppendGlyphs(buf, text, face, x, y)
|
||||
buf = buf[:0]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user