mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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.DrawString(string(r))
|
||||
|
||||
img, _ := ebiten.NewImageFromImage(rgba, ebiten.FilterDefault)
|
||||
g := &glyphImage{
|
||||
image: img,
|
||||
image: nil,
|
||||
x: x,
|
||||
y: 0,
|
||||
width: w,
|
||||
@ -190,6 +189,11 @@ func getGlyphImages(face font.Face, runes []rune) []*glyphImage {
|
||||
|
||||
x += w
|
||||
}
|
||||
|
||||
img, _ := ebiten.NewImageFromImage(rgba, ebiten.FilterDefault)
|
||||
for i := range neededGlyphs {
|
||||
imgs[i].image = img
|
||||
}
|
||||
}
|
||||
return imgs
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user