Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
this.context = context;
this.layers = [];
this.layerMap = new Map();
this.frameRequested = {};
}

/**
Expand Down Expand Up @@ -92,8 +93,6 @@
this.layerMap.set(layer.name, layer);
this.layers.sort((a, b) => a.zIndex - b.zIndex);

this.frameRequested = {};

return layer.context;
}

Expand Down Expand Up @@ -303,12 +302,16 @@
this.urls.texturesAtlas = texturesAtlasUrl;

return new Promise((resolve, reject) => {
this.textures = new TexturePack(
const tempTextures = new TexturePack(
texturesIndexUrl,
texturesAtlasUrl,
(error) => {
if (error) reject(error);
else resolve();
if (error) {
reject(error);
} else {
this.textures = tempTextures;
resolve();
}
},
);
});
Expand Down Expand Up @@ -1319,7 +1322,7 @@
*/
_renderPreviewingPiecePositions(context) {
for (const [index, value] of this._previewingPositions) {
const [_, piece, fillColor = DEFAULT_PREVIEW_FILL_COLOR] = value;

Check warning on line 1325 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'_' is assigned a value but never used

Check warning on line 1325 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'_' is assigned a value but never used
this._renderPreviewPiece(context, index, piece, fillColor);
}
}
Expand Down Expand Up @@ -1883,10 +1886,10 @@
this._layersManager.clear('pieces');
this._renderPlacedPieces(context);
});
this._layersManager.requestAnimationFrame('preview-pieces', (context) => {

Check warning on line 1889 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'context' is defined but never used

Check warning on line 1889 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'context' is defined but never used
this._layersManager.clear('preview-pieces');
});
this._layersManager.requestAnimationFrame('preview-hexagons', (context) => {

Check warning on line 1892 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'context' is defined but never used

Check warning on line 1892 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'context' is defined but never used
this._layersManager.clear('preview-hexagons');
});
}
Expand Down Expand Up @@ -1954,14 +1957,14 @@
if (this._resizeObserver) {
try {
this._resizeObserver.disconnect();
} catch (e) {}

Check warning on line 1960 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'e' is defined but never used

Check warning on line 1960 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'e' is defined but never used
this._resizeObserver = null;
}

if (this._mutationObserver) {
try {
this._mutationObserver.disconnect();
} catch (e) {}

Check warning on line 1967 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'e' is defined but never used

Check warning on line 1967 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'e' is defined but never used
this._mutationObserver = null;
}

Expand Down Expand Up @@ -2019,7 +2022,7 @@
) {
try {
this._container.removeChild(this._canvas);
} catch (e) {}

Check warning on line 2025 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'e' is defined but never used

Check warning on line 2025 in src/renderer.js

View workflow job for this annotation

GitHub Actions / Lint

'e' is defined but never used
}
this._canvas = null;
this._context = null;
Expand Down
Loading