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
@@ -405,7 +405,7 @@ func (e *Editor) PaintText(gtx layout.Context) {
clip.Max = clip.Max.Add(e.viewSize)
for _, shape := range e.shapes {
stack := op.Push(gtx.Ops)
op.TransformOp{}.Offset(shape.offset).Add(gtx.Ops)
op.Offset(shape.offset).Add(gtx.Ops)
shape.clip.Add(gtx.Ops)
paint.PaintOp{Rect: layout.FRect(clip).Sub(shape.offset)}.Add(gtx.Ops)
stack.Pop()