mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 22:56:11 +03:00
Small rotation fixes.
This commit is contained in:
parent
3353bd5f69
commit
50f9a82089
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user