mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
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:
@@ -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"
|
||||
)
|
||||
@@ -35,7 +35,7 @@ func CheckBox(th *Theme, checkBox *widget.Bool, label string) CheckBoxStyle {
|
||||
// Layout updates the checkBox and displays it.
|
||||
func (c CheckBoxStyle) Layout(gtx layout.Context) layout.Dimensions {
|
||||
dims := c.layout(gtx, c.CheckBox.Value, c.CheckBox.Hovered())
|
||||
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
|
||||
c.CheckBox.Layout(gtx)
|
||||
return dims
|
||||
|
||||
Reference in New Issue
Block a user