mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
op: change CallOp to be a return value from MacroOp.Stop
Converting macro := op.Record(ops) ... macro.Stop() macro.Add() to macro := op.Record(ops) ... call := macro.Stop() call.Add(ops) Which is more general (call.Add can take a different ops than the op.Record that started it), and enforced the order between Stop and the subsequent Add. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -158,7 +158,7 @@ func (a Direction) Layout(gtx Context, w Widget) Dimensions {
|
||||
cs := gtx.Constraints
|
||||
gtx.Constraints.Min = image.Point{}
|
||||
dims := w(gtx)
|
||||
macro.Stop()
|
||||
call := macro.Stop()
|
||||
sz := dims.Size
|
||||
if sz.X < cs.Min.X {
|
||||
sz.X = cs.Min.X
|
||||
@@ -181,7 +181,7 @@ func (a Direction) Layout(gtx Context, w Widget) Dimensions {
|
||||
}
|
||||
stack := op.Push(gtx.Ops)
|
||||
op.TransformOp{}.Offset(FPt(p)).Add(gtx.Ops)
|
||||
macro.Add()
|
||||
call.Add(gtx.Ops)
|
||||
stack.Pop()
|
||||
return Dimensions{
|
||||
Size: sz,
|
||||
|
||||
Reference in New Issue
Block a user