io/router: simplify pointer event routing

- Drop pointer.Event.Hit in favour of Enter/Leave events.
- Track enter/leaves for each pointer.ID (updates #122). Add test.
- Resolve grabs once.
- Get rid of scratch slice.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-05-31 13:43:33 +02:00
parent 23c2d44b8c
commit 3b28c5d067
4 changed files with 139 additions and 113 deletions
-5
View File
@@ -31,11 +31,6 @@ type Event struct {
Time time.Duration
// Buttons are the set of pressed mouse buttons for this event.
Buttons Buttons
// Hit is set when the event was within the registered
// area for the handler. Hit can be false when a pointer
// was pressed within the hit area, and then dragged
// outside it.
Hit bool
// Position is the position of the event, relative to
// the current transformation, as set by op.TransformOp.
Position f32.Point