op/clip: document dimensions of Border.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
Chris Waldon
2021-01-19 07:51:55 -05:00
committed by Elias Naur
parent 9231ff47ef
commit d93874005c
+6 -3
View File
@@ -47,17 +47,20 @@ func (rr RRect) Add(ops *op.Ops) {
rr.Op(ops).Add(ops) rr.Op(ops).Add(ops)
} }
// Border represents the clip area of a rectangular border. // Border represents a rectangular border.
type Border struct { type Border struct {
// Rect is the bounds of the border. // Rect is the bounds of the border.
Rect f32.Rectangle Rect f32.Rectangle
// Width of the line tracing Rect.
Width float32 Width float32
Dashes DashSpec Dashes DashSpec
// The corner radii. // The corner radii.
SE, SW, NW, NE float32 SE, SW, NW, NE float32
} }
// Op returns the Op for the border. // Op returns the clip operation for the border. Its area corresponds to a
// stroked line that traces the border rectangle, optionally with rounded
// corners and dashes.
func (b Border) Op(ops *op.Ops) Op { func (b Border) Op(ops *op.Ops) Op {
var p Path var p Path
p.Begin(ops) p.Begin(ops)