mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: Transparent backgrounds result in bleed (#499)
This commit is contained in:
parent
e657372ae4
commit
3de48d2893
1 changed files with 7 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue