mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
rewrite picker color handling (#1487)
This commit is contained in:
parent
a4b49ea350
commit
2c5c770e78
2 changed files with 19 additions and 25 deletions
|
@ -114,8 +114,9 @@ export function renderScene(
|
|||
if (typeof sceneState.viewBackgroundColor === "string") {
|
||||
const hasTransparence =
|
||||
sceneState.viewBackgroundColor === "transparent" ||
|
||||
sceneState.viewBackgroundColor.length === 5 ||
|
||||
sceneState.viewBackgroundColor.length === 9;
|
||||
sceneState.viewBackgroundColor.length === 5 || // #RGBA
|
||||
sceneState.viewBackgroundColor.length === 9 || // #RRGGBBA
|
||||
/(hsla|rgba)\(/.test(sceneState.viewBackgroundColor);
|
||||
if (hasTransparence) {
|
||||
context.clearRect(0, 0, normalizedCanvasWidth, normalizedCanvasHeight);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue