Increase viewport bounds slightly for rotation.

This commit is contained in:
Dominik Picheta 2014-08-19 15:56:23 +01:00
parent a8b6c8d0e1
commit 1c63c96f04

View File

@ -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();
}