canvas node wip

This commit is contained in:
zsviczian
2023-07-07 06:26:39 +02:00
parent de5b8b64a6
commit b869bd6861
8 changed files with 139 additions and 46 deletions

View File

@@ -192,12 +192,15 @@ export class UniversalInsertFileModal extends Modal {
.setButtonText("as Image")
.onClick(async () => {
const ea:ExcalidrawAutomate = getEA(this.view);
const isMarkdown = file && file.extension === "md" && !ea.isExcalidrawFile(file);
ea.selectElementsInView(
[await insertImageToView (
ea,
this.center,
//this.view.currentPosition,
file,
isMarkdown && sectionPicker.selectEl.value && sectionPicker.selectEl.value !== ""
? `${file.path}${sectionPicker.selectEl.value}`
: file,
ea.isExcalidrawFile(file) ? !anchorTo100 : undefined,
)]
);