mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
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
@@ -178,13 +178,13 @@ func (l *List) Layout(ops *ui.Ops) Dimens {
|
||||
Min: axisPoint(l.Axis, min, -ui.Inf),
|
||||
Max: axisPoint(l.Axis, max, ui.Inf),
|
||||
}
|
||||
ops.Begin()
|
||||
ui.OpPush{}.Add(ops)
|
||||
draw.OpClip{Path: draw.RectPath(r)}.Add(ops)
|
||||
ui.OpTransform{
|
||||
Transform: ui.Offset(toPointF(axisPoint(l.Axis, pos, cross))),
|
||||
}.Add(ops)
|
||||
child.block.Add(ops)
|
||||
ops.End().Add(ops)
|
||||
ui.OpPop{}.Add(ops)
|
||||
pos += axisMain(l.Axis, sz)
|
||||
}
|
||||
atStart := l.first == 0 && l.offset <= 0
|
||||
|
||||
Reference in New Issue
Block a user