diff --git a/src/tiledimage.js b/src/tiledimage.js index 9b202819..a1c3054b 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1020,9 +1020,14 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag /** * Get the region of this tiled image that falls within the viewport. * @returns {OpenSeadragon.Rect} the region of this tiled image that falls within the viewport. + * Returns false for images with opacity==0 unless preload==true */ getDrawArea: function(){ + if( this._opacity === 0 && !this._preload){ + return false; + } + var drawArea = this._viewportToTiledImageRectangle( this.viewport.getBoundsWithMargins(true)); @@ -1434,7 +1439,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag let lowestLevel = tiles.length ? tiles[0].level : 0; let drawArea = this.getDrawArea(); - if(!drawArea || (this._opacity === 0 && !this._preload)){ + if(!drawArea){ return; } diff --git a/test/demo/drawercomparison.js b/test/demo/drawercomparison.js index 96793915..bd95deaa 100644 --- a/test/demo/drawercomparison.js +++ b/test/demo/drawercomparison.js @@ -1,5 +1,5 @@ const sources = { - "rainbow":"../data/testpattern.dzi", + "rainbow": "../data/testpattern.dzi", "leaves":"../data/iiif_2_0_sizes/info.json", "bblue":{ type:'image',