mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +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:
@@ -44,7 +44,7 @@ func (e EditorStyle) Layout(gtx layout.Context) layout.Dimensions {
|
||||
paint.ColorOp{Color: e.HintColor}.Add(gtx.Ops)
|
||||
tl := widget.Label{Alignment: e.Editor.Alignment}
|
||||
dims := tl.Layout(gtx, e.shaper, e.Font, e.TextSize, e.Hint)
|
||||
macro.Stop()
|
||||
call := macro.Stop()
|
||||
if w := dims.Size.X; gtx.Constraints.Min.X < w {
|
||||
gtx.Constraints.Min.X = w
|
||||
}
|
||||
@@ -56,7 +56,7 @@ func (e EditorStyle) Layout(gtx layout.Context) layout.Dimensions {
|
||||
paint.ColorOp{Color: e.Color}.Add(gtx.Ops)
|
||||
e.Editor.PaintText(gtx)
|
||||
} else {
|
||||
macro.Add()
|
||||
call.Add(gtx.Ops)
|
||||
}
|
||||
paint.ColorOp{Color: e.Color}.Add(gtx.Ops)
|
||||
e.Editor.PaintCaret(gtx)
|
||||
|
||||
Reference in New Issue
Block a user