From 560cf6054c233a6460219dacb33db2a325f59a59 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 9 Nov 2019 18:31:49 +0100 Subject: [PATCH] op/paint: add note that ClipOp intersects the clip, not replace it Updates #61 Signed-off-by: Elias Naur --- op/paint/path.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/op/paint/path.go b/op/paint/path.go index 225c8b99..8aa1edc5 100644 --- a/op/paint/path.go +++ b/op/paint/path.go @@ -12,7 +12,7 @@ import ( "gioui.org/op" ) -// Path constructs and adds a ClipOp clip path consisting of lines and +// Path constructs a ClipOp clip path described by lines and // Bézier curves. Path generates no garbage and can be used for // dynamic paths; path data is stored directly in the Ops list // supplied to Begin. @@ -25,7 +25,11 @@ type Path struct { macro op.MacroOp } -// ClipOp sets the current clip path. +// ClipOp sets the current clip to the intersection of +// the existing clip with this clip. +// +// If you need to reset the clip to its previous values after +// applying a ClipOp, use op.StackOp. type ClipOp struct { macro op.MacroOp bounds f32.Rectangle