mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-16 14:53:14 +03:00
navigato minimap onClick vertical/horizontal pan fix
This commit is contained in:
parent
784f470744
commit
027dac0d8e
@ -405,10 +405,26 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /*
|
|||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
function onCanvasClick( event ) {
|
function onCanvasClick( event ) {
|
||||||
if ( event.quick && this.viewer.viewport ) {
|
if (event.quick && this.viewer.viewport && (this.panVertical || this.panHorizontal)) {
|
||||||
this.viewer.viewport.panTo(this.viewport.pointFromPixel(event.position));
|
var target,
|
||||||
this.viewer.viewport.applyConstraints();
|
posX,
|
||||||
|
posY;
|
||||||
|
if (!this.panVertical) {
|
||||||
|
// perform only horizonal pan
|
||||||
|
posX = this.viewport.pointFromPixel(event.position).x;
|
||||||
|
posY = this.viewport.getCenter().y;
|
||||||
|
target = new $.Point(posX, posY);
|
||||||
|
} else if (!this.panHorizontal) {
|
||||||
|
// perform only vertical pan
|
||||||
|
posX = this.viewport.getCenter().x;
|
||||||
|
posY = this.viewport.pointFromPixel(event.position).y;
|
||||||
|
target = new $.Point(posX, posY);
|
||||||
|
} else {
|
||||||
|
target = this.viewport.pointFromPixel(event.position);
|
||||||
}
|
}
|
||||||
|
this.viewer.viewport.panTo(target);
|
||||||
|
this.viewer.viewport.applyConstraints();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user