Do not do any canvas work when there are no features to render

This commit is contained in:
Andreas Hocevar
2021-09-21 11:21:01 +00:00
parent 0505d5d379
commit 46b21c2588
2 changed files with 2 additions and 9 deletions

View File

@@ -97,11 +97,7 @@ class CanvasLayerRenderer extends LayerRenderer {
context = canvas.getContext('2d');
}
}
if (
context &&
(context.canvas.width === 0 ||
context.canvas.style.transform === transform)
) {
if (context && context.canvas.style.transform === transform) {
// Container of the previous layer renderer can be used.
this.container = target;
this.context = context;