Small rotation fixes.

This commit is contained in:
Dominik Picheta 2014-08-15 15:47:50 +01:00
parent 3353bd5f69
commit 50f9a82089

View File

@ -398,13 +398,20 @@ function updateViewport( drawer ) {
} }
//Change bounds for rotation //Change bounds for rotation
if (degrees !== 0) { if (degrees === 90 || degrees === 270) {
var rotatedBounds = viewportBounds.rotate( degrees ); var rotatedBounds = viewportBounds.rotate( degrees );
viewportTL = rotatedBounds.getTopLeft(); viewportTL = rotatedBounds.getTopLeft();
viewportBR = rotatedBounds.getBottomRight(); viewportBR = rotatedBounds.getBottomRight();
} }
else if (degrees !== 0) { 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.x -= factor;
viewportTL.y -= factor; viewportTL.y -= factor;
viewportBR.x += factor; viewportBR.x += factor;