io/pointer,io/router,gesture: add pointer.Foremost priority

Replace the pointer.Scroll special case with a new priority that
indicates the foremost handler, checked in gesture.Scroll.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-05 10:46:19 +02:00
parent 2accb88381
commit 65d4707e3e
4 changed files with 47 additions and 18 deletions
+3
View File
@@ -225,6 +225,9 @@ func (s *Scroll) Scroll(cfg unit.Converter, q event.Queue, t time.Time, axis Axi
s.dragging = false
s.grab = false
case pointer.Scroll:
if e.Priority < pointer.Foremost {
continue
}
switch s.axis {
case Horizontal:
s.scroll += e.Scroll.X