mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-20 09:41:45 +03:00
Fixes incorrect flick direction after image is rotated.
This commit is contained in:
parent
4f8b5d6704
commit
a672ca9785
@ -2382,8 +2382,8 @@ function onCanvasDragEnd( event ) {
|
||||
if ( !event.preventDefaultAction && this.viewport ) {
|
||||
gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );
|
||||
if ( gestureSettings.flickEnabled && event.speed >= gestureSettings.flickMinSpeed ) {
|
||||
var amplitudeX = gestureSettings.flickMomentum * ( event.speed * Math.cos( event.direction ) ),
|
||||
amplitudeY = gestureSettings.flickMomentum * ( event.speed * Math.sin( event.direction ) ),
|
||||
var amplitudeX = gestureSettings.flickMomentum * ( event.speed * Math.cos( event.direction - (Math.PI / 180 * this.viewport.degrees) ) ),
|
||||
amplitudeY = gestureSettings.flickMomentum * ( event.speed * Math.sin( event.direction - (Math.PI / 180 * this.viewport.degrees) ) ),
|
||||
center = this.viewport.pixelFromPoint( this.viewport.getCenter( true ) ),
|
||||
target = this.viewport.pointFromPixel( new $.Point( center.x - amplitudeX, center.y - amplitudeY ) );
|
||||
if( !this.panHorizontal ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user