mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
Implements pinch rotate.
This commit is contained in:
parent
e93578fa54
commit
097714cf39
@ -2465,6 +2465,12 @@ function onCanvasPinch( event ) {
|
||||
this.viewport.applyConstraints();
|
||||
}
|
||||
}
|
||||
// Pinch rotate
|
||||
var angle1 = Math.atan2(event.gesturePoints[0].currentPos.y - event.gesturePoints[1].currentPos.y,
|
||||
event.gesturePoints[0].currentPos.x - event.gesturePoints[1].currentPos.x);
|
||||
var angle2 = Math.atan2(event.gesturePoints[0].lastPos.y - event.gesturePoints[1].lastPos.y,
|
||||
event.gesturePoints[0].lastPos.x - event.gesturePoints[1].lastPos.x);
|
||||
this.viewport.setRotation(this.viewport.getRotation() + ((angle1 - angle2) * (180 / Math.PI)));
|
||||
/**
|
||||
* Raised when a pinch event occurs on the {@link OpenSeadragon.Viewer#canvas} element.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user