mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +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
+1
-1
@@ -44,7 +44,7 @@ func (im Image) Layout(gtx layout.Context) layout.Dimensions {
|
||||
defer clip.Rect{Max: dims.Size}.Push(gtx.Ops).Pop()
|
||||
|
||||
pixelScale := scale * gtx.Metric.PxPerDp
|
||||
trans = trans.Mul(f32.Affine2D{}.Scale(f32.Point{}, f32.Pt(pixelScale, pixelScale)))
|
||||
trans = trans.Mul(f32.AffineId().Scale(f32.Point{}, f32.Pt(pixelScale, pixelScale)))
|
||||
defer op.Affine(trans).Push(gtx.Ops).Pop()
|
||||
|
||||
im.Src.Add(gtx.Ops)
|
||||
|
||||
Reference in New Issue
Block a user