cleanup save/restore

This commit is contained in:
dwelle 2025-07-31 14:07:15 +02:00
parent d2d80602e9
commit 051b0cdd4b

View File

@ -36,8 +36,9 @@ const _renderNewElementScene = ({
normalizedHeight,
});
// Apply zoom
context.save();
// Apply zoom
context.scale(appState.zoom.value, appState.zoom.value);
if (newElement && newElement.type !== "selection") {
@ -51,8 +52,6 @@ const _renderNewElementScene = ({
const frameId = newElement.frameId || appState.frameToHighlight?.id;
context.save();
if (
frameId &&
appState.frameRendering.enabled &&
@ -77,11 +76,11 @@ const _renderNewElementScene = ({
renderConfig,
appState,
);
context.restore();
} else {
context.clearRect(0, 0, normalizedWidth, normalizedHeight);
}
context.restore();
}
};