mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
f32: replace Affine2D{} with AffineId() for identity transformations
Reduces ambiguity by introducing AffineId() for representing identity transformation matrices. References: https://todo.sr.ht/~eliasnaur/gio/655 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
This commit is contained in:
committed by
Elias Naur
parent
3e601e73c4
commit
d76b4272aa
+2
-2
@@ -767,7 +767,7 @@ func (s *shaperImpl) Bitmaps(ops *op.Ops, gs []Glyph) op.CallOp {
|
||||
imgOp = bitmapData.img
|
||||
imgSize = bitmapData.size
|
||||
}
|
||||
off := op.Affine(f32.Affine2D{}.Offset(f32.Point{
|
||||
off := op.Affine(f32.AffineId().Offset(f32.Point{
|
||||
X: fixedToFloat((g.X - x) - g.Offset.X),
|
||||
Y: fixedToFloat(g.Offset.Y + g.Bounds.Min.Y),
|
||||
})).Push(ops)
|
||||
@@ -783,7 +783,7 @@ func (s *shaperImpl) Bitmaps(ops *op.Ops, gs []Glyph) op.CallOp {
|
||||
Y: g.Bounds.Max.Y.Round(),
|
||||
},
|
||||
}.Size()
|
||||
aff := op.Affine(f32.Affine2D{}.Scale(f32.Point{}, f32.Point{
|
||||
aff := op.Affine(f32.AffineId().Scale(f32.Point{}, f32.Point{
|
||||
X: float32(glyphSize.X) / float32(imgSize.X),
|
||||
Y: float32(glyphSize.Y) / float32(imgSize.Y),
|
||||
})).Push(ops)
|
||||
|
||||
Reference in New Issue
Block a user