all: replace InvalidateOp with InvalidateCmd command

Curiously, InvalidateCmd is probably the only command that is appropriate
to call during layout.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-11-25 13:57:15 -06:00
parent 0fab08bd6c
commit c515b7804e
9 changed files with 31 additions and 51 deletions
+3 -3
View File
@@ -252,9 +252,6 @@ func (ClickEvent) ImplementsEvent() {}
// as defined in io/pointer.InputOp.
func (s *Scroll) Add(ops *op.Ops) {
event.InputOp(ops, s)
if s.flinger.Active() {
op.InvalidateOp{}.Add(ops)
}
}
// Stop any remaining fling movement.
@@ -336,6 +333,9 @@ func (s *Scroll) Update(cfg unit.Metric, q input.Source, t time.Time, axis Axis,
}
}
total += s.flinger.Tick(t)
if s.flinger.Active() {
q.Execute(op.InvalidateCmd{})
}
return total
}