all: replace deprecated pointer.Rect with clip.Rect

Converted with

gofmt -w -r 'pointer.Rect(r) -> clip.Rect(r)' .
gofmt -w -r 'pointer.Ellipse(r) -> clip.Ellipse(layout.FRect(r))' .

combined with 'goimports -w .' to clean up imports.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-10-26 12:53:54 +02:00
parent 29cea1db49
commit 3e0b72304a
13 changed files with 41 additions and 39 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ package material
import (
"image"
"gioui.org/io/pointer"
"gioui.org/layout"
"gioui.org/op/clip"
"gioui.org/unit"
"gioui.org/widget"
)
@@ -41,7 +41,7 @@ func RadioButton(th *Theme, group *widget.Enum, key, label string) RadioButtonSt
func (r RadioButtonStyle) Layout(gtx layout.Context) layout.Dimensions {
hovered, hovering := r.Group.Hovered()
dims := r.layout(gtx, r.Group.Value == r.Key, hovering && hovered == r.Key)
defer pointer.Rect(image.Rectangle{Max: dims.Size}).Push(gtx.Ops).Pop()
defer clip.Rect(image.Rectangle{Max: dims.Size}).Push(gtx.Ops).Pop()
gtx.Constraints.Min = dims.Size
r.Group.Layout(gtx, r.Key)
return dims