mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
Proper viewport bounds changes for rotation.
This commit is contained in:
parent
50f9a82089
commit
e00e4c53ef
@ -404,18 +404,15 @@ function updateViewport( drawer ) {
|
|||||||
viewportBR = rotatedBounds.getBottomRight();
|
viewportBR = rotatedBounds.getBottomRight();
|
||||||
}
|
}
|
||||||
else if (degrees !== 0) {
|
else if (degrees !== 0) {
|
||||||
/*
|
var orthBounds = viewportBounds.rotate(90);
|
||||||
var factor1 = drawer.viewer.viewport.imageToViewportRectangle(0, 0, 256, 256);
|
var halfWidth = orthBounds.width / 2;
|
||||||
viewportBounds.width += factor1.width;
|
var halfHeight = orthBounds.height / 2;
|
||||||
viewportBounds.height += factor1.width;
|
viewportBounds.x -= halfWidth / 2;
|
||||||
|
viewportBounds.y -= halfHeight / 2;
|
||||||
|
viewportBounds.width += halfWidth;
|
||||||
|
viewportBounds.height += halfHeight;
|
||||||
viewportTL = viewportBounds.getTopLeft();
|
viewportTL = viewportBounds.getTopLeft();
|
||||||
viewportBR = viewportBounds.getBottomRight();
|
viewportBR = viewportBounds.getBottomRight();
|
||||||
*/
|
|
||||||
var factor = 0.3 / drawer.viewer.viewport.getZoom();
|
|
||||||
viewportTL.x -= factor;
|
|
||||||
viewportTL.y -= factor;
|
|
||||||
viewportBR.x += factor;
|
|
||||||
viewportBR.y += factor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Don't draw if completely outside of the viewport
|
//Don't draw if completely outside of the viewport
|
||||||
|
Loading…
Reference in New Issue
Block a user