Fix drawer clearance bounds

This commit is contained in:
Nelson Campos 2018-10-16 17:24:26 +01:00
parent 7a7ba07902
commit cf20d9fb43
2 changed files with 13 additions and 26 deletions

View File

@ -271,7 +271,7 @@
* events between different devices, causing the faster devices to slow down enough to make the zoom control
* more manageable.
*
* @property {Number} [rotationIncrement=90]
* @property {Number} [rotationIncrement=10]
* The number of degrees to rotate right or left when the rotate buttons or keyboard shortcuts are activated.
*
* @property {Number} [pixelsPerWheelLine=40]
@ -1140,7 +1140,7 @@ function OpenSeadragon( options ){
autoResize: true,
preserveImageSizeOnResize: false, // requires autoResize=true
minScrollDeltaTime: 50,
rotationIncrement: 10,
rotationIncrement: 90,
//DEFAULT CONTROL SETTINGS
showSequenceControl: true, //SEQUENCE

View File

@ -1884,21 +1884,14 @@ function drawTiles( tiledImage, lastDrawn ) {
.getIntegerBoundingBox()
.times($.pixelDensityRatio);
// if((tiledImage._drawer.viewer.viewport.flipped && !tiledImage.flipped) || (!tiledImage._drawer.viewer.viewport.flipped && tiledImage.flipped) ) {
// tiledImage._drawer._flip({});
// bounds.width = bounds.width - bounds.x;
// bounds.width = tiledImage._drawer.viewer.viewport.getContainerSize().width - bounds.x;
// console.log("BOUNDS before: ", bounds);
// bounds.width = bounds.width + bounds.x;
// bounds.x = -bounds.x;
// console.log("Bounds Image: ", tiledImage._drawer.viewer.viewport.getContainerSize());
// }
if((tiledImage._drawer.viewer.viewport.flipped && !tiledImage.flipped) || (!tiledImage._drawer.viewer.viewport.flipped && tiledImage.flipped) ) {
if (tiledImage.viewport.degrees !== 0 || tiledImage.getRotation(true) % 360 !== 0){
bounds.x = tiledImage._drawer.viewer.container.clientWidth - (bounds.x + bounds.width);
}
}
}
tiledImage._drawer._clear(true, bounds);
}
console.log("BOUNDS after: ", bounds);
// When scaling, we must rotate only when blending the sketch canvas to
// avoid interpolation
if (!sketchScale) {
@ -1919,7 +1912,6 @@ function drawTiles( tiledImage, lastDrawn ) {
if (tiledImage.viewport.degrees == 0 && tiledImage.getRotation(true) % 360 == 0){
if((tiledImage._drawer.viewer.viewport.flipped && !tiledImage.flipped) || (!tiledImage._drawer.viewer.viewport.flipped && tiledImage.flipped) ) {
console.log("FLIP1");
tiledImage._drawer._flip({});
}
}
@ -1998,13 +1990,6 @@ function drawTiles( tiledImage, lastDrawn ) {
if (tiledImage.viewport.degrees !== 0) {
tiledImage._drawer._restoreRotationChanges(useSketch);
}
// if (tiledImage.viewport.degrees == 0 && tiledImage.getRotation(true) % 360 == 0){
// if((tiledImage._drawer.viewer.viewport.flipped && !tiledImage.flipped) || (!tiledImage._drawer.viewer.viewport.flipped && tiledImage.flipped) ) {
// console.log("FLIP2");
// tiledImage._drawer._flip({});
// }
// }
}
if (useSketch) {
@ -2041,13 +2026,15 @@ function drawTiles( tiledImage, lastDrawn ) {
}
}
if (tiledImage.viewport.degrees == 0 && tiledImage.getRotation(true) % 360 == 0){
if((tiledImage._drawer.viewer.viewport.flipped && !tiledImage.flipped) || (!tiledImage._drawer.viewer.viewport.flipped && tiledImage.flipped) ) {
console.log("FLIP3");
tiledImage._drawer._flip({});
if (!sketchScale) {
if (tiledImage.viewport.degrees == 0 && tiledImage.getRotation(true) % 360 == 0){
if((tiledImage._drawer.viewer.viewport.flipped && !tiledImage.flipped) || (!tiledImage._drawer.viewer.viewport.flipped && tiledImage.flipped) ) {
tiledImage._drawer._flip({});
}
}
}
drawDebugInfo( tiledImage, lastDrawn );
}