gesture
package gesture
Type members
Classlikes
case class Drag(from: Vec2d, fromTimestamp: Long, to: Vec2d, toTimestamp: Long) extends PointerState
case class DragAbort(from: Vec2d, fromTimestamp: Long, to: Vec2d, toTimestamp: Long) extends GestureEvent
case class DragComplete(from: Vec2d, fromTimestamp: Long, to: Vec2d, toTimestamp: Long, delta: Vec2d) extends GestureEvent
case class DragMove(from: Vec2d, fromTimestamp: Long, to: Vec2d, toTimestamp: Long, delta: Vec2d) extends GestureEvent
case class DragStart(from: Vec2d, fromTimestamp: Long, to: Vec2d, toTimestamp: Long, delta: Vec2d) extends GestureEvent
abstract class GestureAndRegionProcessor[R](dragThreshold: Double, ClickDistThreshold: Double, ClickTimeThreshold: Double)
class GestureProcessor(dragThreshold: Double, ClickDistThreshold: Double, ClickTimeThreshold: Double)
We convert from dom.PointerEvent to an internal ADT representation for 3 reasons:
We convert from dom.PointerEvent to an internal ADT representation for 3 reasons:
- Sealed traits are better in match statements than raw PointerEvents which have a String
type
field. - PointerEvents are hard to create and set timestamps on in unit tests
- PointerEvents arent always supported in non-dom environments like Nodejs where we might want to test
- Companion:
- object