mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix exported size when drawing to the left (#575)
If you scroll and draw to the left of the origin, when you export the scene, there's a weird whitespace on the right. This is because we do the min() computation starting at 0 and not -Infinity This also fixes pasted elements and scrollbars.
This commit is contained in:
parent
4b0f788945
commit
e1ed40be65
3 changed files with 6 additions and 6 deletions
|
@ -1382,9 +1382,9 @@ export class App extends React.Component<any, AppState> {
|
|||
elements = clearSelection(elements);
|
||||
|
||||
let subCanvasX1 = Infinity;
|
||||
let subCanvasX2 = 0;
|
||||
let subCanvasX2 = -Infinity;
|
||||
let subCanvasY1 = Infinity;
|
||||
let subCanvasY2 = 0;
|
||||
let subCanvasY2 = -Infinity;
|
||||
|
||||
const minX = Math.min(...parsedElements.map(element => element.x));
|
||||
const minY = Math.min(...parsedElements.map(element => element.y));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue