mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 17:05:38 +00:00
io/pointer: unify area ops into a single AreaOp
Make Rect and Ellipse constructors of AreaOp. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -258,7 +258,7 @@ func (e *Editor) layout(gtx *layout.Context, sh *text.Shaper) {
|
||||
r.Min.Y -= pointerPadding
|
||||
r.Max.X += pointerPadding
|
||||
r.Max.X += pointerPadding
|
||||
pointer.RectAreaOp{Rect: r}.Add(gtx.Ops)
|
||||
pointer.Rect(r).Add(gtx.Ops)
|
||||
e.scroller.Add(gtx.Ops)
|
||||
e.clicker.Add(gtx.Ops)
|
||||
e.caretOn = false
|
||||
|
||||
@@ -72,7 +72,7 @@ func (b Button) Layout(gtx *layout.Context, button *widget.Button) {
|
||||
widget.Label{}.Layout(gtx, b.shaper, b.Font, b.Text)
|
||||
})
|
||||
})
|
||||
pointer.RectAreaOp{Rect: image.Rectangle{Max: gtx.Dimensions.Size}}.Add(gtx.Ops)
|
||||
pointer.Rect(image.Rectangle{Max: gtx.Dimensions.Size}).Add(gtx.Ops)
|
||||
button.Layout(gtx)
|
||||
})
|
||||
bg := st.Expand(gtx, func() {
|
||||
@@ -105,7 +105,7 @@ func (b IconButton) Layout(gtx *layout.Context, button *widget.Button) {
|
||||
Size: image.Point{X: size, Y: size},
|
||||
}
|
||||
})
|
||||
pointer.EllipseAreaOp{Rect: image.Rectangle{Max: gtx.Dimensions.Size}}.Add(gtx.Ops)
|
||||
pointer.Ellipse(image.Rectangle{Max: gtx.Dimensions.Size}).Add(gtx.Ops)
|
||||
button.Layout(gtx)
|
||||
})
|
||||
bgcol := b.Background
|
||||
|
||||
@@ -63,5 +63,5 @@ func (c *checkable) layout(gtx *layout.Context, checked bool) {
|
||||
})
|
||||
|
||||
flex.Layout(gtx, ico, lbl)
|
||||
pointer.RectAreaOp{Rect: image.Rectangle{Max: gtx.Dimensions.Size}}.Add(gtx.Ops)
|
||||
pointer.Rect(image.Rectangle{Max: gtx.Dimensions.Size}).Add(gtx.Ops)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user