mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-24 14:16:10 +03:00
Merge pull request #1549 from nelsonn3c/fix-flip-slides-when-using-opacity-and-multiple-slides
Fix flip slides when using opacity and multiple slides
This commit is contained in:
commit
65c8ff71a2
@ -500,10 +500,6 @@ $.Drawer.prototype = {
|
||||
|
||||
if ( this.viewport.degrees !== 0 ) {
|
||||
this._offsetForRotation({degrees: this.viewport.degrees});
|
||||
} else{
|
||||
if(this.viewer.viewport.flipped) {
|
||||
this._flip();
|
||||
}
|
||||
}
|
||||
if (tiledImage.getRotation(true) % 360 !== 0) {
|
||||
this._offsetForRotation({
|
||||
@ -512,6 +508,11 @@ $.Drawer.prototype = {
|
||||
tiledImage._getRotationPoint(true), true)
|
||||
});
|
||||
}
|
||||
if (tiledImage.viewport.degrees === 0 && tiledImage.getRotation(true) % 360 === 0){
|
||||
if(tiledImage._drawer.viewer.viewport.getFlip()) {
|
||||
tiledImage._drawer._flip();
|
||||
}
|
||||
}
|
||||
|
||||
context.strokeRect(
|
||||
tile.position.x * $.pixelDensityRatio,
|
||||
@ -577,6 +578,13 @@ $.Drawer.prototype = {
|
||||
if (tiledImage.getRotation(true) % 360 !== 0) {
|
||||
this._restoreRotationChanges();
|
||||
}
|
||||
|
||||
if (tiledImage.viewport.degrees === 0 && tiledImage.getRotation(true) % 360 === 0){
|
||||
if(tiledImage._drawer.viewer.viewport.getFlip()) {
|
||||
tiledImage._drawer._flip();
|
||||
}
|
||||
}
|
||||
|
||||
context.restore();
|
||||
},
|
||||
|
||||
|
@ -1675,7 +1675,7 @@ function blendTile( tiledImage, tile, x, y, level, levelOpacity, currentTime ){
|
||||
|
||||
tiledImage.lastDrawn.push( tile );
|
||||
|
||||
if ( opacity == 1 ) {
|
||||
if ( opacity === 1 ) {
|
||||
setCoverage( tiledImage.coverage, level, x, y, true );
|
||||
tiledImage._hasOpaqueTile = true;
|
||||
} else if ( deltaTime < blendTimeMillis ) {
|
||||
@ -1879,6 +1879,12 @@ function drawTiles( tiledImage, lastDrawn ) {
|
||||
tiledImage.getClippedBounds(true))
|
||||
.getIntegerBoundingBox()
|
||||
.times($.pixelDensityRatio);
|
||||
|
||||
if(tiledImage._drawer.viewer.viewport.getFlip()) {
|
||||
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);
|
||||
}
|
||||
@ -1891,10 +1897,6 @@ function drawTiles( tiledImage, lastDrawn ) {
|
||||
degrees: tiledImage.viewport.degrees,
|
||||
useSketch: useSketch
|
||||
});
|
||||
} else {
|
||||
if(tiledImage._drawer.viewer.viewport.flipped) {
|
||||
tiledImage._drawer._flip({});
|
||||
}
|
||||
}
|
||||
if (tiledImage.getRotation(true) % 360 !== 0) {
|
||||
tiledImage._drawer._offsetForRotation({
|
||||
@ -1904,6 +1906,12 @@ function drawTiles( tiledImage, lastDrawn ) {
|
||||
useSketch: useSketch
|
||||
});
|
||||
}
|
||||
|
||||
if (tiledImage.viewport.degrees === 0 && tiledImage.getRotation(true) % 360 === 0){
|
||||
if(tiledImage._drawer.viewer.viewport.getFlip()) {
|
||||
tiledImage._drawer._flip();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var usedClip = false;
|
||||
@ -1978,10 +1986,6 @@ function drawTiles( tiledImage, lastDrawn ) {
|
||||
}
|
||||
if (tiledImage.viewport.degrees !== 0) {
|
||||
tiledImage._drawer._restoreRotationChanges(useSketch);
|
||||
} else{
|
||||
if(tiledImage._drawer.viewer.viewport.flipped) {
|
||||
tiledImage._drawer._flip({});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2018,6 +2022,15 @@ function drawTiles( tiledImage, lastDrawn ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!sketchScale) {
|
||||
if (tiledImage.viewport.degrees === 0 && tiledImage.getRotation(true) % 360 === 0){
|
||||
if(tiledImage._drawer.viewer.viewport.getFlip()) {
|
||||
tiledImage._drawer._flip();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
drawDebugInfo( tiledImage, lastDrawn );
|
||||
}
|
||||
|
||||
|
@ -1531,7 +1531,7 @@ $.Viewport.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets flip state stored on viewport.
|
||||
* Get flip state stored on viewport.
|
||||
* @function
|
||||
* @return {Boolean} Flip state.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user