Do not do any canvas work when there are no features to render
This commit is contained in:
@@ -97,11 +97,7 @@ class CanvasLayerRenderer extends LayerRenderer {
|
|||||||
context = canvas.getContext('2d');
|
context = canvas.getContext('2d');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (context && context.canvas.style.transform === transform) {
|
||||||
context &&
|
|
||||||
(context.canvas.width === 0 ||
|
|
||||||
context.canvas.style.transform === transform)
|
|
||||||
) {
|
|
||||||
// Container of the previous layer renderer can be used.
|
// Container of the previous layer renderer can be used.
|
||||||
this.container = target;
|
this.container = target;
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
|||||||
@@ -256,10 +256,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|||||||
(!replayGroup || replayGroup.isEmpty()) &&
|
(!replayGroup || replayGroup.isEmpty()) &&
|
||||||
(!declutterExecutorGroup || declutterExecutorGroup.isEmpty())
|
(!declutterExecutorGroup || declutterExecutorGroup.isEmpty())
|
||||||
) {
|
) {
|
||||||
if (!this.containerReused && canvas.width > 0) {
|
return null;
|
||||||
canvas.width = 0;
|
|
||||||
}
|
|
||||||
return this.container;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// resize and clear
|
// resize and clear
|
||||||
|
|||||||
Reference in New Issue
Block a user