mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
op/clip: move Rect to shapes.go
It's a specialized shape like the others. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user