mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
Merge pull request #929 from 1-2-3/master
fix: scripts not work with arrows that contain text.
This commit is contained in:
@@ -308,16 +308,8 @@ function loadELK(doAfterLoaded) {
|
||||
function normalizeSelectedArrows() {
|
||||
let gapValue = 2;
|
||||
|
||||
const selectedIndividualArrows = ea
|
||||
.getMaximumGroups(ea.getViewSelectedElements())
|
||||
.reduce(
|
||||
(result, group) =>
|
||||
group.length === 1 &&
|
||||
(group[0].type === "arrow" || group[0].type === "line")
|
||||
? [...result, group[0]]
|
||||
: result,
|
||||
[]
|
||||
);
|
||||
const selectedIndividualArrows = ea.getMaximumGroups(ea.getViewSelectedElements())
|
||||
.reduce((result, g) => [...result, ...g.filter(el => el.type === 'arrow')], []);
|
||||
|
||||
const allElements = ea.getViewElements();
|
||||
for (const arrow of selectedIndividualArrows) {
|
||||
|
||||
@@ -26,8 +26,7 @@ if(!settings["Gap"]) {
|
||||
let gapValue = settings["Gap"].value;
|
||||
|
||||
const selectedIndividualArrows = ea.getMaximumGroups(ea.getViewSelectedElements())
|
||||
.reduce((result, group) => (group.length === 1 && (group[0].type === 'arrow' || group[0].type === 'line')) ?
|
||||
[...result, group[0]] : result, []);
|
||||
.reduce((result, g) => [...result, ...g.filter(el => el.type === 'arrow')], []);
|
||||
|
||||
const allElements = ea.getViewElements();
|
||||
for(const arrow of selectedIndividualArrows) {
|
||||
|
||||
Reference in New Issue
Block a user