From 8a4ef0cc2e0d149c724f6b2f10c66fe7777cb5d1 Mon Sep 17 00:00:00 2001 From: Mutlu Koesem Date: Wed, 9 Aug 2017 11:39:17 +0200 Subject: [PATCH] Fix placeholderFillStyle on tiledImage has no effect --- src/tiledimage.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index 8851a933..b9c83838 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1805,15 +1805,19 @@ function compareTiles( previousBest, tile ) { * @param {OpenSeadragon.Tile[]} lastDrawn - An unordered list of Tiles drawn last frame. */ function drawTiles( tiledImage, lastDrawn ) { - if (tiledImage.opacity === 0 || lastDrawn.length === 0) { + if (tiledImage.opacity === 0 || (lastDrawn.length === 0 && !tiledImage.placeholderFillStyle)) { return; } - var tile = lastDrawn[0]; - var useSketch = tiledImage.opacity < 1 || - (tiledImage.compositeOperation && - tiledImage.compositeOperation !== 'source-over') || - (!tiledImage._isBottomItem() && tile._hasTransparencyChannel()); + var tile = lastDrawn[0]; + var useSketch; + + if (tile) { + useSketch = tiledImage.opacity < 1 || + (tiledImage.compositeOperation && + tiledImage.compositeOperation !== 'source-over') || + (!tiledImage._isBottomItem() && tile._hasTransparencyChannel()); + } var sketchScale; var sketchTranslate;