mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
examples/texti18n: bug fix: space characters were ignored
This commit is contained in:
parent
3ab50c91df
commit
198bd4788e
@ -203,21 +203,18 @@ func (g *Game) drawGlyphs(dst *ebiten.Image, output *shaping.Output, originX, or
|
||||
v, ok := g.glyphCache[key]
|
||||
if !ok {
|
||||
data := output.Face.GlyphData(glyph.GlyphID).(api.GlyphOutline)
|
||||
if len(data.Segments) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
segs := make([]api.Segment, len(data.Segments))
|
||||
for i, seg := range data.Segments {
|
||||
segs[i] = seg
|
||||
for j := range seg.Args {
|
||||
segs[i].Args[j].X *= scale
|
||||
segs[i].Args[j].Y *= scale
|
||||
segs[i].Args[j].Y *= -1
|
||||
if len(data.Segments) > 0 {
|
||||
segs := make([]api.Segment, len(data.Segments))
|
||||
for i, seg := range data.Segments {
|
||||
segs[i] = seg
|
||||
for j := range seg.Args {
|
||||
segs[i].Args[j].X *= scale
|
||||
segs[i].Args[j].Y *= scale
|
||||
segs[i].Args[j].Y *= -1
|
||||
}
|
||||
}
|
||||
v.image, v.point = segmentsToImage(segs, orig)
|
||||
}
|
||||
|
||||
v.image, v.point = segmentsToImage(segs, orig)
|
||||
if g.glyphCache == nil {
|
||||
g.glyphCache = map[glyphCacheKey]glyphCacheValue{}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user