io/pointer: add Drag event type

This eliminates needless redraws for handlers that care about drag events and not move events, like gesture.Scroll.

Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
This commit is contained in:
Gordon Klaus
2020-06-03 18:44:42 +02:00
committed by Elias Naur
parent cb5cc02560
commit 1a070a36b6
5 changed files with 14 additions and 6 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ Types
Only events that match a specified list of types are delivered to a handler.
For example, to receive Press, Move, and Release events (but not Enter,
For example, to receive Press, Drag, and Release events (but not Move, Enter,
Leave, or Scroll):
var ops op.Ops
@@ -20,7 +20,7 @@ Leave, or Scroll):
pointer.InputOp{
Tag: h,
Types: pointer.Press | pointer.Move | pointer.Release,
Types: pointer.Press | pointer.Drag | pointer.Release,
}.Add(ops)
Scroll events are only delivered to the foremost scroll handler.