Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: Transparent backgrounds result in bleed (#499)

lissitz3de48d289362
diff --git a/src/renderer/renderScene.ts b/src/renderer/renderScene.ts
index 14ae67b995..742196b80c 100644
--- a/src/renderer/renderScene.ts
+++ b/src/renderer/renderScene.ts
@@ -36,6 +36,13 @@ export function renderScene(
const fillStyle = context.fillStyle;
if (typeof sceneState.viewBackgroundColor === "string") {
+ const hasTransparence =
+ sceneState.viewBackgroundColor === "transparent" ||
+ sceneState.viewBackgroundColor.length === 5 ||
+ sceneState.viewBackgroundColor.length === 9;
+ if (hasTransparence) {
+ context.clearRect(0, 0, canvas.width, canvas.height);
+ }
context.fillStyle = sceneState.viewBackgroundColor;
context.fillRect(0, 0, canvas.width, canvas.height);
} else {