Code for flickering tile

This commit is contained in:
Toni Munder 2015-09-13 19:20:34 -07:00
parent 55cc86e040
commit 561d091005

View File

@ -675,9 +675,15 @@ function updateViewport( tiledImage ) {
viewportBounds.y -= tiledImage._ySpring.current.value;
// Reset tile's internal drawn state
var _hasOpaqueTile;
while ( tiledImage.lastDrawn.length > 0 ) {
tile = tiledImage.lastDrawn.pop();
tile.beingDrawn = false;
if (tile.beingDrawn === false) {
_hasOpaqueTile = false;
}
}
//Change bounds for rotation
@ -1151,6 +1157,7 @@ function blendTile( tiledImage, tile, x, y, level, levelOpacity, currentTime ){
if ( opacity == 1 ) {
setCoverage( tiledImage.coverage, level, x, y, true );
this._hasOpaqueTile = true;
} else if ( deltaTime < blendTimeMillis ) {
return true;
}
@ -1299,7 +1306,7 @@ function drawTiles( tiledImage, lastDrawn ) {
usedClip = true;
}
if ( tiledImage.placeholderFillStyle && lastDrawn.length === 0 ) {
if ( tiledImage.placeholderFillStyle && this._hasOpaqueTile === false ) {
var placeholderRect = tiledImage._drawer.viewportToDrawerRectangle(tiledImage.getBounds(true));
var fillStyle = null;