mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user