mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
text: Bug fix: one image should be used for multiple glyphs (#535)
This commit is contained in:
parent
6caebc2310
commit
be3d529767
@ -174,9 +174,8 @@ func getGlyphImages(face font.Face, runes []rune) []*glyphImage {
|
|||||||
d.Dot = fixed.Point26_6{fixed.I(x) - b.Min.X, -b.Min.Y}
|
d.Dot = fixed.Point26_6{fixed.I(x) - b.Min.X, -b.Min.Y}
|
||||||
d.DrawString(string(r))
|
d.DrawString(string(r))
|
||||||
|
|
||||||
img, _ := ebiten.NewImageFromImage(rgba, ebiten.FilterDefault)
|
|
||||||
g := &glyphImage{
|
g := &glyphImage{
|
||||||
image: img,
|
image: nil,
|
||||||
x: x,
|
x: x,
|
||||||
y: 0,
|
y: 0,
|
||||||
width: w,
|
width: w,
|
||||||
@ -190,6 +189,11 @@ func getGlyphImages(face font.Face, runes []rune) []*glyphImage {
|
|||||||
|
|
||||||
x += w
|
x += w
|
||||||
}
|
}
|
||||||
|
|
||||||
|
img, _ := ebiten.NewImageFromImage(rgba, ebiten.FilterDefault)
|
||||||
|
for i := range neededGlyphs {
|
||||||
|
imgs[i].image = img
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return imgs
|
return imgs
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user