~eliasnaur/gio

ac62e3a7ab85899e1f373fd11e1db6fcc55d6ccd — Elias Naur 7 days ago 7a13c2c
op/clip: add Rect.Add shorthand

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 5 insertions(+), 0 deletions(-)

M op/clip/clip.go
M op/clip/clip.go => op/clip/clip.go +5 -0
@@ 317,6 317,11 @@ func (rr Rect) Op(ops *op.Ops) Op {
	return roundRect(ops, r, rr.SE, rr.SW, rr.NW, rr.NE)
}

// Add is a shorthand for Op(ops).Add(ops).
func (rr Rect) Add(ops *op.Ops) {
	rr.Op(ops).Add(ops)
}

// roundRect returns the clip area of a rectangle with rounded
// corners defined by their radii.
func roundRect(ops *op.Ops, r f32.Rectangle, se, sw, nw, ne float32) Op {