mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-24 22:26:10 +03:00
Merge pull request #21 from openseadragon/pinchzoompoint
patch for pinch zoom point.
This commit is contained in:
commit
65cc3f55e9
@ -695,6 +695,10 @@
|
|||||||
THIS[ tracker.hash ].lastPinchDelta =
|
THIS[ tracker.hash ].lastPinchDelta =
|
||||||
Math.abs( touchA.x - touchB.x ) +
|
Math.abs( touchA.x - touchB.x ) +
|
||||||
Math.abs( touchA.y - touchB.y );
|
Math.abs( touchA.y - touchB.y );
|
||||||
|
THIS[ tracker.hash ].pinchMidpoint = new $.Point(
|
||||||
|
( touchA.x + touchB.x ) / 2 ,
|
||||||
|
( touchA.y + touchB.y ) / 2
|
||||||
|
);
|
||||||
//$.console.debug("pinch start : "+THIS[ tracker.hash ].lastPinchDelta);
|
//$.console.debug("pinch start : "+THIS[ tracker.hash ].lastPinchDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -756,6 +760,7 @@
|
|||||||
}
|
}
|
||||||
if( event.touches.length + event.changedTouches.length == 2 ){
|
if( event.touches.length + event.changedTouches.length == 2 ){
|
||||||
THIS[ tracker.hash ].lastPinchDelta = null;
|
THIS[ tracker.hash ].lastPinchDelta = null;
|
||||||
|
THIS[ tracker.hash ].pinchMidpoint = null;
|
||||||
//$.console.debug("pinch end");
|
//$.console.debug("pinch end");
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -961,8 +966,8 @@
|
|||||||
|
|
||||||
onMouseWheelSpin( tracker, {
|
onMouseWheelSpin( tracker, {
|
||||||
shift: false,
|
shift: false,
|
||||||
pageX: ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2,
|
pageX: THIS[ tracker.hash ].pinchMidpoint.x,
|
||||||
pageY: ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2,
|
pageY: THIS[ tracker.hash ].pinchMidpoint.y,
|
||||||
detail:(
|
detail:(
|
||||||
THIS[ tracker.hash ].lastPinchDelta > pinchDelta
|
THIS[ tracker.hash ].lastPinchDelta > pinchDelta
|
||||||
) ? 1 : -1
|
) ? 1 : -1
|
||||||
|
Loading…
Reference in New Issue
Block a user