@@ -321,7 +321,7 @@ const generateElementCanvas = (
321321 return {
322322 element,
323323 canvas,
324- theme : appState . theme ,
324+ theme : renderConfig . theme ,
325325 scale,
326326 zoomValue : zoom . value ,
327327 canvasOffsetX,
@@ -538,7 +538,6 @@ export let elementWithCanvasCache = new WeakMap<
538538
539539export const clearRenderCache = ( ) => {
540540 elementWithCanvasCache = new WeakMap ( ) ;
541- pathsCache = new WeakMap ( ) ;
542541} ;
543542
544543const generateElementWithCanvas = (
@@ -567,7 +566,7 @@ const generateElementWithCanvas = (
567566 if (
568567 ! prevElementWithCanvas ||
569568 shouldRegenerateBecauseZoom ||
570- prevElementWithCanvas . theme !== appState . theme ||
569+ prevElementWithCanvas . theme !== renderConfig . theme ||
571570 prevElementWithCanvas . boundTextElementVersion !== boundTextElementVersion ||
572571 prevElementWithCanvas . imageCrop !== imageCrop ||
573572 prevElementWithCanvas . containingFrameOpacity !== containingFrameOpacity ||
@@ -748,14 +747,14 @@ export const renderElement = (
748747
749748 context . lineWidth = FRAME_STYLE . strokeWidth / appState . zoom . value ;
750749 context . strokeStyle =
751- appState . theme === THEME . DARK
750+ renderConfig . theme === THEME . DARK
752751 ? applyDarkModeFilter ( FRAME_STYLE . strokeColor )
753752 : FRAME_STYLE . strokeColor ;
754753
755754 // TODO change later to only affect AI frames
756755 if ( isMagicFrameElement ( element ) ) {
757756 context . strokeStyle =
758- appState . theme === THEME . LIGHT
757+ renderConfig . theme === THEME . LIGHT
759758 ? "#7affd7"
760759 : applyDarkModeFilter ( "#1d8264" ) ;
761760 }
0 commit comments