mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-24 22:26:10 +03:00
account for viewport rotation in addition to tiledImage rotation
This commit is contained in:
parent
5b2c6d7ed9
commit
d4e82d374e
@ -242,7 +242,10 @@
|
||||
if ( tiledImage.placeholderFillStyle && tiledImage._hasOpaqueTile === false ) {
|
||||
this._drawPlaceholder(tiledImage);
|
||||
}
|
||||
|
||||
this._drawPlaceholder(tiledImage);
|
||||
if(!window.draw){
|
||||
return;
|
||||
}
|
||||
if(tilesToDraw.length === 0 || tiledImage.getOpacity() === 0){
|
||||
return;
|
||||
}
|
||||
@ -1095,13 +1098,13 @@
|
||||
fillStyle = tiledImage.placeholderFillStyle;
|
||||
}
|
||||
|
||||
context.save();
|
||||
this._offsetForRotation({degrees: this.viewer.viewport.getRotation(true)});
|
||||
context.fillStyle = fillStyle;
|
||||
context.translate(rect.x, rect.y);
|
||||
context.rotate(Math.PI / 180 * bounds.degrees);
|
||||
context.translate(-rect.x, -rect.y);
|
||||
context.fillRect(rect.x, rect.y, rect.width, rect.height);
|
||||
context.restore();
|
||||
this._restoreRotationChanges();
|
||||
|
||||
}
|
||||
|
||||
|
@ -64,8 +64,10 @@
|
||||
crossOriginPolicy: 'Anonymous'
|
||||
});
|
||||
|
||||
viewer.addOnceHandler('canvas-click', function(event) {
|
||||
if (event.quick) {
|
||||
let swapped = false;
|
||||
viewer.addHandler('canvas-click', function(event) {
|
||||
if (event.quick && !swapped) {
|
||||
swapped = true;
|
||||
var standin = viewer.world.getItemAt(0);
|
||||
var standinBounds = standin.getBounds();
|
||||
viewer.viewport.fitBounds(standinBounds);
|
||||
|
Loading…
Reference in New Issue
Block a user