mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: constrain export dialog preview size (#6475)
This commit is contained in:
parent
801412bf6b
commit
4d0d844e39
2 changed files with 16 additions and 14 deletions
|
@ -79,7 +79,11 @@ export const exportToCanvas = ({
|
|||
|
||||
const max = Math.max(width, height);
|
||||
|
||||
const scale = maxWidthOrHeight / max;
|
||||
// if content is less then maxWidthOrHeight, fallback on supplied scale
|
||||
const scale =
|
||||
maxWidthOrHeight < max
|
||||
? maxWidthOrHeight / max
|
||||
: appState?.exportScale ?? 1;
|
||||
|
||||
canvas.width = width * scale;
|
||||
canvas.height = height * scale;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue