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:
Walter Werner SCHNEIDER
2025-07-09 13:38:17 +03:00
committed by Elias Naur
parent 3e601e73c4
commit d76b4272aa
15 changed files with 49 additions and 35 deletions
+1 -1
View File
@@ -183,7 +183,7 @@ func (c CallOp) Add(o *Ops) {
// Offset converts an offset to a TransformOp.
func Offset(off image.Point) TransformOp {
offf := f32.Pt(float32(off.X), float32(off.Y))
return Affine(f32.Affine2D{}.Offset(offf))
return Affine(f32.AffineId().Offset(offf))
}
// Affine creates a TransformOp representing the transformation a.