mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
text/v2: bug fix: Glyph's XOffset/YOffset should be considered
This commit is contained in:
parent
159c19a671
commit
d8af9dff28
@ -299,7 +299,10 @@ func (g *GoTextFace) appendGlyphsForLine(glyphs []Glyph, line string, indexOffse
|
|||||||
}
|
}
|
||||||
_, gs := g.Source.shape(line, g)
|
_, gs := g.Source.shape(line, g)
|
||||||
for _, glyph := range gs {
|
for _, glyph := range gs {
|
||||||
img, imgX, imgY := g.glyphImage(glyph, origin)
|
img, imgX, imgY := g.glyphImage(glyph, origin.Add(fixed.Point26_6{
|
||||||
|
X: glyph.shapingGlyph.XOffset,
|
||||||
|
Y: -glyph.shapingGlyph.YOffset,
|
||||||
|
}))
|
||||||
// Append a glyph even if img is nil.
|
// Append a glyph even if img is nil.
|
||||||
// This is necessary to return index information for control characters.
|
// This is necessary to return index information for control characters.
|
||||||
glyphs = append(glyphs, Glyph{
|
glyphs = append(glyphs, Glyph{
|
||||||
|
Loading…
Reference in New Issue
Block a user