skip drawing zero-opacity images for webgl drawer. remove checks for preload in html and canvas drawers since that is done in tiledimage.

This commit is contained in:
Tom 2024-02-01 10:46:45 -05:00
parent 921171ed2b
commit 68623ace26
4 changed files with 4 additions and 4 deletions

View File

@ -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);
} }
} }

View File

@ -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);
} }
}); });

View File

@ -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];