Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle committed Nov 25, 2023
1 parent d3913e3 commit 2834f17
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
18 changes: 11 additions & 7 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1754,14 +1754,18 @@ class App extends React.Component<AppProps, AppState> {
});

const blob = await exportToBlob({
elements: this.scene.getNonDeletedElements(),
appState: {
...this.state,
exportBackground: true,
viewBackgroundColor: this.state.viewBackgroundColor,
data: {
elements: this.scene.getNonDeletedElements(),
appState: {
...this.state,
exportBackground: true,
viewBackgroundColor: this.state.viewBackgroundColor,
},
files: this.files,
},
config: {
exportingFrame: magicFrame,
},
exportingFrame: magicFrame,
files: this.files,
});

const dataURL = await getDataURL(blob);
Expand Down
16 changes: 10 additions & 6 deletions src/components/TTDDialog/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,16 @@ export const convertMermaidToExcalidraw = async ({
};

const canvas = await exportToCanvas({
elements: data.current.elements,
files: data.current.files,
exportPadding: DEFAULT_EXPORT_PADDING,
maxWidthOrHeight:
Math.max(parent.offsetWidth, parent.offsetHeight) *
window.devicePixelRatio,
data: {
elements: data.current.elements,
files: data.current.files,
},
config: {
padding: DEFAULT_EXPORT_PADDING,
maxWidthOrHeight:
Math.max(parent.offsetWidth, parent.offsetHeight) *
window.devicePixelRatio,
},
});
// if converting to blob fails, there's some problem that will
// likely prevent preview and export (e.g. canvas too big)
Expand Down

0 comments on commit 2834f17

Please sign in to comment.