all: [API] change op.Offset to take integer coordinates

op.Offset is a convenience function most often used by layouts. Layouts
usually operate in integer coordinates, and the float32 version of op.Offset
needlessly force conversions from int to float32. This change makes op.Offset
take integer coordinates, to better match its intended use.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-04-26 09:22:10 +02:00
parent 14805af367
commit a63e0cb44a
23 changed files with 70 additions and 72 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ func (s Stack) Layout(gtx Context, children ...StackChild) Dimensions {
case SW, S, SE:
p.Y = maxSZ.Y - sz.Y
}
trans := op.Offset(FPt(p)).Push(gtx.Ops)
trans := op.Offset(p).Push(gtx.Ops)
ch.call.Add(gtx.Ops)
trans.Pop()
if baseline == 0 {