all: remove redundant op.TransformOp.Offset

Use op.Offset instead, or create and manipulate a f32.Affine2D.

API change. Update your code with a gofmt rule:

	gofmt -r 'op.TransformOp{}.Offset -> op.Offset'

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-21 22:41:56 +02:00
parent 9e3d3b6f58
commit 878131189b
11 changed files with 29 additions and 35 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ func (l Label) Layout(gtx layout.Context, s text.Shaper, font text.Font, size un
}
lclip := layout.FRect(clip).Sub(off)
stack := op.Push(gtx.Ops)
op.TransformOp{}.Offset(off).Add(gtx.Ops)
op.Offset(off).Add(gtx.Ops)
str := txt[start:end]
s.ShapeString(font, textSize, str, l).Add(gtx.Ops)
paint.PaintOp{Rect: lclip}.Add(gtx.Ops)