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
+2 -2
View File
@@ -281,10 +281,10 @@ func drawInk(gtx layout.Context, c widget.Press) {
ink := paint.ColorOp{Color: color.RGBA{A: ba, R: bc, G: bc, B: bc}}
ink.Add(gtx.Ops)
rr := size * .5
op.TransformOp{}.Offset(c.Position).Offset(f32.Point{
op.Offset(c.Position.Add(f32.Point{
X: -rr,
Y: -rr,
}).Add(gtx.Ops)
})).Add(gtx.Ops)
clip.Rect{
Rect: f32.Rectangle{Max: f32.Point{
X: float32(size),