mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
op/clip: remove Op.Add
The Add method was a compatibility stop-gap. API change. Use clip.Op.Push and Pop the return value to explicitly mark the region affected by the clip operation. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-12
@@ -41,18 +41,11 @@ func init() {
|
||||
// state to the intersection of the current p.
|
||||
func (p Op) Push(o *op.Ops) Stack {
|
||||
id, macroID := ops.PushOp(&o.Internal, ops.ClipStack)
|
||||
p.add(o, true)
|
||||
p.add(o)
|
||||
return Stack{ops: &o.Internal, id: id, macroID: macroID}
|
||||
}
|
||||
|
||||
// Add is like Push except it doesn't save the current state on the stack.
|
||||
//
|
||||
// Deprecated: use Push instead.
|
||||
func (p Op) Add(o *op.Ops) {
|
||||
p.add(o, false)
|
||||
}
|
||||
|
||||
func (p Op) add(o *op.Ops, push bool) {
|
||||
func (p Op) add(o *op.Ops) {
|
||||
path := p.path
|
||||
outline := p.outline
|
||||
|
||||
@@ -87,9 +80,6 @@ func (p Op) add(o *op.Ops, push bool) {
|
||||
if outline {
|
||||
data[17] = byte(1)
|
||||
}
|
||||
if push {
|
||||
data[18] = byte(1)
|
||||
}
|
||||
}
|
||||
|
||||
func (s Stack) Pop() {
|
||||
|
||||
Reference in New Issue
Block a user