mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
text: fix bitmap y offset computation
This commit fixes a bug that would incorrectly baseline bitmap glyphs text if the line contained another font with a taller line height. The logic for computing the y offset of the glyph incorrectly assumed that the Glyph.Ascent was particular to the glyph instead of the line. I've updated it to use a glyph-specific value. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
+1
-1
@@ -674,7 +674,7 @@ func (s *shaperImpl) Bitmaps(ops *op.Ops, gs []Glyph) op.CallOp {
|
|||||||
}
|
}
|
||||||
off := op.Affine(f32.Affine2D{}.Offset(f32.Point{
|
off := op.Affine(f32.Affine2D{}.Offset(f32.Point{
|
||||||
X: fixedToFloat((g.X - x) - g.Offset.X),
|
X: fixedToFloat((g.X - x) - g.Offset.X),
|
||||||
Y: fixedToFloat(g.Offset.Y - g.Ascent),
|
Y: fixedToFloat(g.Offset.Y + g.Bounds.Min.Y),
|
||||||
})).Push(ops)
|
})).Push(ops)
|
||||||
cl := clip.Rect{Max: imgSize}.Push(ops)
|
cl := clip.Rect{Max: imgSize}.Push(ops)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user