mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-19 17:21:50 +03:00
attempt no.2 to fix #2160
This commit is contained in:
parent
7d6437b2cd
commit
325f65fe5c
@ -506,7 +506,7 @@ $.Viewport.prototype = {
|
|||||||
var leftDx = this._contentBoundsNoRotate.x - boundsRight + horizontalThreshold;
|
var leftDx = this._contentBoundsNoRotate.x - boundsRight + horizontalThreshold;
|
||||||
var rightDx = contentRight - newBounds.x - horizontalThreshold;
|
var rightDx = contentRight - newBounds.x - horizontalThreshold;
|
||||||
|
|
||||||
if (horizontalThreshold > this._contentBoundsNoRotate.width) {
|
if (horizontalThreshold > this._contentBoundsNoRotate.width && horizontalThreshold <= 1) {
|
||||||
newBounds.x += (leftDx + rightDx) / 2;
|
newBounds.x += (leftDx + rightDx) / 2;
|
||||||
} else if (rightDx < 0) {
|
} else if (rightDx < 0) {
|
||||||
newBounds.x += rightDx;
|
newBounds.x += rightDx;
|
||||||
@ -524,7 +524,7 @@ $.Viewport.prototype = {
|
|||||||
var topDy = this._contentBoundsNoRotate.y - boundsBottom + verticalThreshold;
|
var topDy = this._contentBoundsNoRotate.y - boundsBottom + verticalThreshold;
|
||||||
var bottomDy = contentBottom - newBounds.y - verticalThreshold;
|
var bottomDy = contentBottom - newBounds.y - verticalThreshold;
|
||||||
|
|
||||||
if (verticalThreshold > this._contentBoundsNoRotate.height) {
|
if (verticalThreshold > this._contentBoundsNoRotate.height && verticalThreshold <= 1) {
|
||||||
newBounds.y += (topDy + bottomDy) / 2;
|
newBounds.y += (topDy + bottomDy) / 2;
|
||||||
} else if (bottomDy < 0) {
|
} else if (bottomDy < 0) {
|
||||||
newBounds.y += bottomDy;
|
newBounds.y += bottomDy;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user