op: remove operation list argument from MacroOp.Add

The ability to invoke other operation lists belongs in the new CallOp.

While we're here, make MacroOp.Add use a pointer receiver to match the
other methods.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-12-11 23:16:59 +01:00
parent 0768fbe590
commit edc81ea0bb
9 changed files with 17 additions and 33 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ func (f *Flex) Layout(gtx *Context, children ...FlexChild) {
var stack op.StackOp
stack.Push(gtx.Ops)
op.TransformOp{}.Offset(toPointF(axisPoint(f.Axis, mainSize, cross))).Add(gtx.Ops)
child.macro.Add(gtx.Ops)
child.macro.Add()
stack.Pop()
mainSize += axisMain(f.Axis, dims.Size)
if i < len(children)-1 {
+1 -1
View File
@@ -173,7 +173,7 @@ func (a Align) Layout(gtx *Context, w Widget) {
var stack op.StackOp
stack.Push(gtx.Ops)
op.TransformOp{}.Offset(toPointF(p)).Add(gtx.Ops)
macro.Add(gtx.Ops)
macro.Add()
stack.Pop()
gtx.Dimensions = Dimensions{
Size: sz,
+2 -2
View File
@@ -262,7 +262,7 @@ func (l *List) layout() Dimensions {
stack.Push(ops)
clip.Rect{Rect: toRectF(r)}.Op(ops).Add(ops)
op.TransformOp{}.Offset(toPointF(axisPoint(l.Axis, pos, cross))).Add(ops)
child.macro.Add(ops)
child.macro.Add()
stack.Pop()
pos += childSize
}
@@ -276,7 +276,7 @@ func (l *List) layout() Dimensions {
l.macro.Stop()
pointer.Rect(image.Rectangle{Max: dims}).Add(ops)
l.scroll.Add(ops)
l.macro.Add(ops)
l.macro.Add()
return Dimensions{Size: dims}
}
+1 -1
View File
@@ -97,7 +97,7 @@ func (s *Stack) Layout(gtx *Context, children ...StackChild) {
var stack op.StackOp
stack.Push(gtx.Ops)
op.TransformOp{}.Offset(toPointF(p)).Add(gtx.Ops)
ch.macro.Add(gtx.Ops)
ch.macro.Add()
stack.Pop()
if baseline == 0 {
if b := ch.dims.Baseline; b != 0 {