From 50f9a82089c134ed9f81295a294311563f8737ca Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Fri, 15 Aug 2014 15:47:50 +0100 Subject: [PATCH] Small rotation fixes. --- src/drawer.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/drawer.js b/src/drawer.js index a8db0265..5e4b59b7 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -398,13 +398,20 @@ function updateViewport( drawer ) { } //Change bounds for rotation - if (degrees !== 0) { + if (degrees === 90 || degrees === 270) { var rotatedBounds = viewportBounds.rotate( degrees ); viewportTL = rotatedBounds.getTopLeft(); viewportBR = rotatedBounds.getBottomRight(); } else if (degrees !== 0) { - var factor = 0.5 / drawer.viewer.viewport.getZoom(); + /* + var factor1 = drawer.viewer.viewport.imageToViewportRectangle(0, 0, 256, 256); + viewportBounds.width += factor1.width; + viewportBounds.height += factor1.width; + viewportTL = viewportBounds.getTopLeft(); + viewportBR = viewportBounds.getBottomRight(); + */ + var factor = 0.3 / drawer.viewer.viewport.getZoom(); viewportTL.x -= factor; viewportTL.y -= factor; viewportBR.x += factor;