mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +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:
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"gioui.org/f32"
|
||||
"gioui.org/internal/f32color"
|
||||
"gioui.org/io/pointer"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/op"
|
||||
"gioui.org/op/clip"
|
||||
@@ -124,7 +123,7 @@ func (s SwitchStyle) Layout(gtx layout.Context) layout.Dimensions {
|
||||
}
|
||||
defer op.Offset(clickOff).Push(gtx.Ops).Pop()
|
||||
sz := image.Pt(clickSize, clickSize)
|
||||
defer pointer.Ellipse(image.Rectangle{Max: sz}).Push(gtx.Ops).Pop()
|
||||
defer clip.Ellipse(f32.Rectangle{Max: layout.FPt(sz)}).Push(gtx.Ops).Pop()
|
||||
gtx.Constraints.Min = sz
|
||||
s.Switch.Layout(gtx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user