diff --git a/op/clip/clip.go b/op/clip/clip.go index b16a27ba..9a9c3088 100644 --- a/op/clip/clip.go +++ b/op/clip/clip.go @@ -387,19 +387,3 @@ func (o Outline) Op() Op { outline: true, } } - -// Rect represents the clip area of a pixel-aligned rectangle. -type Rect image.Rectangle - -// Op returns the op for the rectangle. -func (r Rect) Op() Op { - return Op{ - bounds: image.Rectangle(r), - outline: true, - } -} - -// Add the clip operation. -func (r Rect) Add(ops *op.Ops) { - r.Op().Add(ops) -} diff --git a/op/clip/shapes.go b/op/clip/shapes.go index 28287a7d..aecdffb4 100644 --- a/op/clip/shapes.go +++ b/op/clip/shapes.go @@ -3,10 +3,28 @@ package clip import ( + "image" + "gioui.org/f32" "gioui.org/op" ) +// Rect represents the clip area of a pixel-aligned rectangle. +type Rect image.Rectangle + +// Op returns the op for the rectangle. +func (r Rect) Op() Op { + return Op{ + bounds: image.Rectangle(r), + outline: true, + } +} + +// Add the clip operation. +func (r Rect) Add(ops *op.Ops) { + r.Op().Add(ops) +} + // UniformRRect returns an RRect with all corner radii set to the // provided radius. func UniformRRect(rect f32.Rectangle, radius float32) RRect {