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
+1
-1
@@ -893,7 +893,7 @@ func gio_firstRectForCharacterRange(h C.uintptr_t, crng C.NSRange, actual C.NSRa
|
||||
// Transform to NSView local coordinates (lower left origin, undo backing scale).
|
||||
scale := 1. / float32(C.getViewBackingScale(w.view))
|
||||
height := float32(C.viewHeight(w.view))
|
||||
local := f32.Affine2D{}.Scale(f32.Pt(0, 0), f32.Pt(scale, -scale)).Offset(f32.Pt(0, height))
|
||||
local := f32.AffineId().Scale(f32.Pt(0, 0), f32.Pt(scale, -scale)).Offset(f32.Pt(0, height))
|
||||
t := local.Mul(sel.Transform)
|
||||
bounds := f32.Rectangle{
|
||||
Min: t.Transform(sel.Pos.Sub(f32.Pt(0, sel.Ascent))),
|
||||
|
||||
Reference in New Issue
Block a user