From 325f65fe5c70a7b63a62dd1d2324c368b79912ac Mon Sep 17 00:00:00 2001 From: Joe DF <3848219+joedf@users.noreply.github.com> Date: Wed, 18 May 2022 11:16:28 -0400 Subject: [PATCH] attempt no.2 to fix #2160 --- src/viewport.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/viewport.js b/src/viewport.js index be350af9..451b602c 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -506,7 +506,7 @@ $.Viewport.prototype = { var leftDx = this._contentBoundsNoRotate.x - boundsRight + horizontalThreshold; var rightDx = contentRight - newBounds.x - horizontalThreshold; - if (horizontalThreshold > this._contentBoundsNoRotate.width) { + if (horizontalThreshold > this._contentBoundsNoRotate.width && horizontalThreshold <= 1) { newBounds.x += (leftDx + rightDx) / 2; } else if (rightDx < 0) { newBounds.x += rightDx; @@ -524,7 +524,7 @@ $.Viewport.prototype = { var topDy = this._contentBoundsNoRotate.y - boundsBottom + verticalThreshold; var bottomDy = contentBottom - newBounds.y - verticalThreshold; - if (verticalThreshold > this._contentBoundsNoRotate.height) { + if (verticalThreshold > this._contentBoundsNoRotate.height && verticalThreshold <= 1) { newBounds.y += (topDy + bottomDy) / 2; } else if (bottomDy < 0) { newBounds.y += bottomDy;