From ac62e3a7ab85899e1f373fd11e1db6fcc55d6ccd Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 20 May 2020 10:21:11 +0200 Subject: [PATCH] op/clip: add Rect.Add shorthand Signed-off-by: Elias Naur --- op/clip/clip.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/op/clip/clip.go b/op/clip/clip.go index 2abc18bc..6a1f47c2 100644 --- a/op/clip/clip.go +++ b/op/clip/clip.go @@ -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 {