mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
prevent exporting empty canvas
This commit is contained in:
parent
f091e9813e
commit
4eda1cfb5d
1 changed files with 2 additions and 0 deletions
|
@ -34,6 +34,8 @@ function exportAsPNG({
|
||||||
exportVisibleOnly,
|
exportVisibleOnly,
|
||||||
exportPadding = 10
|
exportPadding = 10
|
||||||
}) {
|
}) {
|
||||||
|
if ( !elements.length ) return window.alert("Cannot export empty canvas.");
|
||||||
|
|
||||||
// deselect & rerender
|
// deselect & rerender
|
||||||
|
|
||||||
clearSelection();
|
clearSelection();
|
||||||
|
|
Loading…
Add table
Reference in a new issue