mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Fix undefined return from getFlip
Navigator setFlip was looking for tiledImage flip state using the getFlip method. The item this.viewer.world._items[0] can be undefined and trying to use its methods would fail.
This commit is contained in:
parent
4fe5a84170
commit
546efcc1db
@ -284,7 +284,7 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /*
|
||||
setFlip: function(state) {
|
||||
this.viewport.setFlip(state);
|
||||
|
||||
var flip = ((this.viewport.getFlip() && !this.viewer.world._items[0].getFlip()) || (!this.viewport.getFlip() && this.viewer.world._items[0].getFlip()));
|
||||
var flip = ((this.viewport.getFlip() && this.viewer.world._items[0] && !this.viewer.world._items[0].getFlip()) || (!this.viewport.getFlip() && this.viewer.world._items[0] && this.viewer.world._items[0].getFlip()));
|
||||
this.setDisplayTransform(flip ? "scale(-1,1)" : "scale(1,1)");
|
||||
return this;
|
||||
},
|
||||
|
@ -3367,7 +3367,7 @@ function updateOnce( viewer ) {
|
||||
THIS[ viewer.hash ].animating = animated;
|
||||
|
||||
// Update navigator flip transformation
|
||||
if (viewer.navigator && viewer.viewport != "undefined"){
|
||||
if (viewer.navigator && viewer.viewport != undefined){
|
||||
viewer.navigator.setFlip(viewer.viewport.getFlip());
|
||||
}
|
||||
//viewer.profiler.endUpdate();
|
||||
|
Loading…
Reference in New Issue
Block a user