From 1c63c96f0415ed2a1c65f6b438b24e3be8903904 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Tue, 19 Aug 2014 15:56:23 +0100 Subject: [PATCH] Increase viewport bounds slightly for rotation. --- src/drawer.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/drawer.js b/src/drawer.js index 64d2b671..248266ba 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -405,12 +405,10 @@ function updateViewport( drawer ) { } else if (degrees !== 0) { var orthBounds = viewportBounds.rotate(90); - var halfWidth = orthBounds.width / 2; - var halfHeight = orthBounds.height / 2; - viewportBounds.x -= halfWidth / 2; - viewportBounds.y -= halfHeight / 2; - viewportBounds.width += halfWidth; - viewportBounds.height += halfHeight; + viewportBounds.x -= orthBounds.width / 2; + viewportBounds.y -= orthBounds.height / 2; + viewportBounds.width += orthBounds.width; + viewportBounds.height += orthBounds.height; viewportTL = viewportBounds.getTopLeft(); viewportBR = viewportBounds.getBottomRight(); }