op: rename StackOp/Push/Pop to StateOp/Save/Load

The semantics were relaxed in a previous commit; this change renames
to operations accordingly.

API change. Use gofmt to adjust your code accordingly:

gofmt -r 'op.Push(a).Pop() -> op.Save(a).Load()'
gofmt -r 'op.Push(a) -> op.Save(a)'
gofmt -r 'v.Pop() -> v.Load()'
gofmt -r 'op.StackOp -> op.StateOp'

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-01-12 20:48:41 +01:00
parent ae2c74ec13
commit d331dd2de8
25 changed files with 177 additions and 177 deletions
+3 -3
View File
@@ -253,11 +253,11 @@ func (l *List) layout(ops *op.Ops, macro op.MacroOp) Dimensions {
Min: l.Axis.point(min, -inf),
Max: l.Axis.point(max, inf),
}
stack := op.Push(ops)
stack := op.Save(ops)
clip.Rect(r).Add(ops)
op.Offset(FPt(l.Axis.point(pos, cross))).Add(ops)
child.call.Add(ops)
stack.Pop()
stack.Load()
pos += childSize
}
atStart := l.Position.First == 0 && l.Position.Offset <= 0
@@ -274,7 +274,7 @@ func (l *List) layout(ops *op.Ops, macro op.MacroOp) Dimensions {
}
dims := l.Axis.point(pos, maxCross)
call := macro.Stop()
defer op.Push(ops).Pop()
defer op.Save(ops).Load()
pointer.Rect(image.Rectangle{Max: dims}).Add(ops)
l.scroll.Add(ops)
call.Add(ops)