mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Update App.tsx
This commit is contained in:
parent
f5ab3e4e12
commit
4e863e5796
1 changed files with 13 additions and 12 deletions
|
@ -2952,18 +2952,19 @@ class App extends React.Component<AppProps, AppState> {
|
|||
this.setState({ errorMessage: t("errors.imageToolNotSupported") });
|
||||
return;
|
||||
}
|
||||
|
||||
const imageElement = this.createImageElement({ sceneX, sceneY });
|
||||
this.insertImageElement(imageElement, file);
|
||||
this.initializeImageDimensions(imageElement);
|
||||
this.setState({
|
||||
selectedElementIds: makeNextSelectedElementIds(
|
||||
{
|
||||
[imageElement.id]: true,
|
||||
},
|
||||
this.state,
|
||||
),
|
||||
});
|
||||
for (const file of event.clipboardData.files) {
|
||||
const imageElement = this.createImageElement({ sceneX, sceneY });
|
||||
this.insertImageElement(imageElement, file);
|
||||
this.initializeImageDimensions(imageElement);
|
||||
this.setState({
|
||||
selectedElementIds: makeNextSelectedElementIds(
|
||||
{
|
||||
[imageElement.id]: true,
|
||||
},
|
||||
this.state,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue