forked from joejulian/gio
ui: make OpPush and OpPop explicit
We're about to allow OpBlock for invoking ops from multiple (cached) Ops containers. To allow for drawing state changes to stick after invoking such a cached block, we can't let OpBlock perform an implicit save and restore of drawing state. Instead, introduce OpPush and OpPop for explicit drawing state stack management. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -157,12 +157,12 @@ func (f *Flex) Layout(ops *ui.Ops, children ...FlexChild) Dimens {
|
||||
cross = f.maxBaseline - b
|
||||
}
|
||||
}
|
||||
ops.Begin()
|
||||
ui.OpPush{}.Add(ops)
|
||||
ui.OpTransform{
|
||||
Transform: ui.Offset(toPointF(axisPoint(f.Axis, mainSize, cross))),
|
||||
}.Add(ops)
|
||||
child.block.Add(ops)
|
||||
ops.End().Add(ops)
|
||||
ui.OpPop{}.Add(ops)
|
||||
mainSize += axisMain(f.Axis, dims.Size)
|
||||
switch f.MainAxisAlignment {
|
||||
case SpaceEvenly:
|
||||
|
||||
Reference in New Issue
Block a user