Fix perf regression (#880)
This commit is contained in:
parent
30434e3e6c
commit
86f9f32a59
@ -244,7 +244,9 @@ function generateElement(
|
|||||||
const zoom = sceneState ? sceneState.zoom : 1;
|
const zoom = sceneState ? sceneState.zoom : 1;
|
||||||
const prevElementWithCanvas = elementWithCanvasCache.get(element);
|
const prevElementWithCanvas = elementWithCanvasCache.get(element);
|
||||||
if (!prevElementWithCanvas || prevElementWithCanvas.canvasZoom !== zoom) {
|
if (!prevElementWithCanvas || prevElementWithCanvas.canvasZoom !== zoom) {
|
||||||
return generateElementCanvas(element, zoom);
|
const elementWithCanvas = generateElementCanvas(element, zoom);
|
||||||
|
elementWithCanvasCache.set(element, elementWithCanvas);
|
||||||
|
return elementWithCanvas;
|
||||||
}
|
}
|
||||||
return prevElementWithCanvas;
|
return prevElementWithCanvas;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user