Set scale for export images (#416)

This commit is contained in:
Timur Khazamov 2020-01-17 15:19:56 +03:00 committed by GitHub
parent 71570a325b
commit 82f559f826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 86 additions and 60 deletions

View file

@ -478,18 +478,23 @@ export class App extends React.Component<{}, AppState> {
appState={this.state}
actionManager={this.actionManager}
syncActionResult={this.syncActionResult}
onExportToPng={exportedElements => {
onExportToPng={(exportedElements, scale) => {
if (this.canvas)
exportCanvas("png", exportedElements, this.canvas, this.state);
exportCanvas("png", exportedElements, this.canvas, {
exportBackground: this.state.exportBackground,
name: this.state.name,
viewBackgroundColor: this.state.viewBackgroundColor,
scale
});
}}
onExportToClipboard={exportedElements => {
onExportToClipboard={(exportedElements, scale) => {
if (this.canvas)
exportCanvas(
"clipboard",
exportedElements,
this.canvas,
this.state
);
exportCanvas("clipboard", exportedElements, this.canvas, {
exportBackground: this.state.exportBackground,
name: this.state.name,
viewBackgroundColor: this.state.viewBackgroundColor,
scale
});
}}
/>
{this.actionManager.renderAction(