Fix perf regression (#880)

This commit is contained in:
Pete Hunt 2020-03-08 23:08:26 -07:00 committed by GitHub
parent 30434e3e6c
commit 86f9f32a59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -244,7 +244,9 @@ function generateElement(
const zoom = sceneState ? sceneState.zoom : 1;
const prevElementWithCanvas = elementWithCanvasCache.get(element);
if (!prevElementWithCanvas || prevElementWithCanvas.canvasZoom !== zoom) {
return generateElementCanvas(element, zoom);
const elementWithCanvas = generateElementCanvas(element, zoom);
elementWithCanvasCache.set(element, elementWithCanvas);
return elementWithCanvas;
}
return prevElementWithCanvas;
}