fix: cleanup after rebase

This commit is contained in:
Arnošt Pleskot 2023-08-18 19:00:38 +02:00
parent c2870a6df5
commit 5ff4e0d640
No known key found for this signature in database
3 changed files with 14 additions and 29 deletions

View file

@ -402,6 +402,7 @@ const bootstrapCanvas = ({
theme,
isExporting,
viewBackgroundColor,
exportWithFancyBackground,
}: {
canvas: HTMLCanvasElement;
scale: number;
@ -410,6 +411,7 @@ const bootstrapCanvas = ({
theme?: AppState["theme"];
isExporting?: StaticCanvasRenderConfig["isExporting"];
viewBackgroundColor?: StaticCanvasAppState["viewBackgroundColor"];
exportWithFancyBackground?: boolean;
}): CanvasRenderingContext2D => {
const context = canvas.getContext("2d")!;
@ -419,7 +421,6 @@ const bootstrapCanvas = ({
if (isExporting && theme === "dark") {
context.filter = THEME_FILTER;
}
// Paint background
if (typeof viewBackgroundColor === "string") {
const hasTransparence =
@ -434,7 +435,7 @@ const bootstrapCanvas = ({
context.fillStyle = viewBackgroundColor;
context.fillRect(0, 0, normalizedWidth, normalizedHeight);
context.restore();
} else {
} else if (!exportWithFancyBackground) {
context.clearRect(0, 0, normalizedWidth, normalizedHeight);
}
@ -924,6 +925,7 @@ const _renderStaticScene = ({
theme: appState.theme,
isExporting,
viewBackgroundColor: appState.viewBackgroundColor,
exportWithFancyBackground: renderConfig.exportWithFancyBackground,
});
// Apply zoom