mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +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
@@ -88,7 +88,7 @@ func BenchmarkDrawUI(b *testing.B) {
|
||||
resetOps(gtx)
|
||||
|
||||
off := float32(math.Mod(float64(i)/10, 10))
|
||||
t := op.Affine(f32.Affine2D{}.Offset(f32.Pt(off, off))).Push(gtx.Ops)
|
||||
t := op.Affine(f32.AffineId().Offset(f32.Pt(off, off))).Push(gtx.Ops)
|
||||
|
||||
drawCore(gtx, th)
|
||||
|
||||
@@ -110,7 +110,7 @@ func BenchmarkDrawUITransformed(b *testing.B) {
|
||||
resetOps(gtx)
|
||||
|
||||
angle := float32(math.Mod(float64(i)/1000, 0.05))
|
||||
a := f32.Affine2D{}.Shear(f32.Point{}, angle, angle).Rotate(f32.Point{}, angle)
|
||||
a := f32.AffineId().Shear(f32.Point{}, angle, angle).Rotate(f32.Point{}, angle)
|
||||
t := op.Affine(a).Push(gtx.Ops)
|
||||
|
||||
drawCore(gtx, th)
|
||||
|
||||
Reference in New Issue
Block a user