mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Merge pull request #2462 from pearcetm/fix-zero-opacity-case
Fix zero opacity case
This commit is contained in:
commit
98769af678
@ -102,7 +102,7 @@ class CanvasDrawer extends $.DrawerBase{
|
|||||||
this._prepareNewFrame(); // prepare to draw a new frame
|
this._prepareNewFrame(); // prepare to draw a new frame
|
||||||
|
|
||||||
for(const tiledImage of tiledImages){
|
for(const tiledImage of tiledImages){
|
||||||
if (tiledImage.opacity !== 0 || tiledImage._preload) {
|
if (tiledImage.opacity !== 0) {
|
||||||
this._drawTiles(tiledImage);
|
this._drawTiles(tiledImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ class HTMLDrawer extends $.DrawerBase{
|
|||||||
var _this = this;
|
var _this = this;
|
||||||
this._prepareNewFrame(); // prepare to draw a new frame
|
this._prepareNewFrame(); // prepare to draw a new frame
|
||||||
tiledImages.forEach(function(tiledImage){
|
tiledImages.forEach(function(tiledImage){
|
||||||
if (tiledImage.opacity !== 0 || tiledImage._preload) {
|
if (tiledImage.opacity !== 0) {
|
||||||
_this._drawTiles(tiledImage);
|
_this._drawTiles(tiledImage);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1020,9 +1020,14 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
/**
|
/**
|
||||||
* Get the region of this tiled image that falls within the viewport.
|
* 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 {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(){
|
getDrawArea: function(){
|
||||||
|
|
||||||
|
if( this._opacity === 0 && !this._preload){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var drawArea = this._viewportToTiledImageRectangle(
|
var drawArea = this._viewportToTiledImageRectangle(
|
||||||
this.viewport.getBoundsWithMargins(true));
|
this.viewport.getBoundsWithMargins(true));
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@
|
|||||||
|
|
||||||
let tilesToDraw = tiledImage.getTilesToDraw();
|
let tilesToDraw = tiledImage.getTilesToDraw();
|
||||||
|
|
||||||
if(tilesToDraw.length === 0){
|
if(tilesToDraw.length === 0 || tiledImage.getOpacity() === 0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let firstTile = tilesToDraw[0];
|
let firstTile = tilesToDraw[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user