mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
ui: replace PushOp, PopOp with a StackOp
Before this change, there was no guarantee that a PopOp matched the intended PushOp. With a single stack operation, the client is forced to match pop with the right push. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-2
@@ -157,12 +157,13 @@ func (f *Flex) Layout(children ...FlexChild) Dimens {
|
||||
cross = f.maxBaseline - b
|
||||
}
|
||||
}
|
||||
ui.PushOp{}.Add(f.ops)
|
||||
var stack ui.StackOp
|
||||
stack.Push(f.ops)
|
||||
ui.TransformOp{
|
||||
Transform: ui.Offset(toPointF(axisPoint(f.Axis, mainSize, cross))),
|
||||
}.Add(f.ops)
|
||||
child.macro.Add(f.ops)
|
||||
ui.PopOp{}.Add(f.ops)
|
||||
stack.Pop()
|
||||
mainSize += axisMain(f.Axis, dims.Size)
|
||||
if i < len(children)-1 {
|
||||
switch f.MainAxisAlignment {
|
||||
|
||||
Reference in New Issue
Block a user