Skip to content

Commit

Permalink
fix: improperly cache-busting on canvas scale instead of zoom (excali…
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle authored Apr 17, 2023
1 parent f640ddc commit c3e8dda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/renderer/renderElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export interface ExcalidrawElementWithCanvas {
canvas: HTMLCanvasElement;
theme: RenderConfig["theme"];
scale: number;
zoomValue: RenderConfig["zoom"]["value"];
canvasOffsetX: number;
canvasOffsetY: number;
boundTextElementVersion: number | null;
Expand Down Expand Up @@ -202,6 +203,7 @@ const generateElementCanvas = (
canvas,
theme: renderConfig.theme,
scale,
zoomValue: zoom.value,
canvasOffsetX,
canvasOffsetY,
boundTextElementVersion: getBoundTextElement(element)?.version || null,
Expand Down Expand Up @@ -712,7 +714,7 @@ const generateElementWithCanvas = (
const prevElementWithCanvas = elementWithCanvasCache.get(element);
const shouldRegenerateBecauseZoom =
prevElementWithCanvas &&
prevElementWithCanvas.scale !== zoom.value &&
prevElementWithCanvas.zoomValue !== zoom.value &&
!renderConfig?.shouldCacheIgnoreZoom;
const boundTextElementVersion = getBoundTextElement(element)?.version || null;

Expand Down

0 comments on commit c3e8dda

Please sign in to comment.