openseadragon/openseadragon — pull request #369 by msalsbery (2014-03-31 21:13:44+00:00)
Title: New Multi-Touch MouseTracker

Added support for the [WC3 Pointer Events Spec](http://www.w3.org/TR/pointerevents/) used by IE10+/Windows 8+, and also under development for Firefox.

Multi-Touch enabled. Now supports multiple simultaneous pointing devices and multiple touch points.

Added a pinchHandler callback to MouseTracker and corresponding pinch zoom handling in Viewer. Pinch gestures are now handled without mimicking scroll wheel events.

Added a dragEndHandler callback to MouseTracker and corresponding kinetic panning for touch device input in Viewer.

Added real-time velocity (speed and direction) tracking to drag-related gestures. The values are included in the event parameters of the corresponding MouseTracker event callbacks. Currently used for kinetic panning (flick gesture) on touch devices. Can be used to detect a swipe gesture as well.

## Known Issues

I've left IE8 related code commented out. Are we going to support this still? For MouseTracker it's not a huge problem except for mouse capture. I'll work it in there if we want to keep supporting it.

I haven't implemented and tested MouseTracker stopHandler functionality. On what pointer devices to we want that implemented?

As discussed at #352, Viewport.applyConstraints() combined with kinetic panning can cause an undesirable bounce effect with an image zoomed out smaller than the viewer window and a fast flick gesture. applyConstraints() is working by design - you can get the same effect with the mouse in the current release. I'm working right now on making this a better experience on touch devices, but if it requires any changes to applyConstraints(), I would prefer that to be a new issue as it's outside the scope of this patch (if there's no objections). I'm hoping to have a suitable fix without going into that, most likely before this patch lands.