op/clip: add Rect.Add shorthand

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-05-20 10:21:11 +02:00
parent 7a13c2c905
commit ac62e3a7ab
+5
View File
@@ -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 {