Merge pull request #378 from 1-2-3/master

Ignore individual arrows in Fixed spacing and Fixed vertical distance scripts
This commit is contained in:
zsviczian
2022-01-21 17:52:37 +01:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -15,7 +15,8 @@ const spacing = parseInt (await utils.inputPrompt("spacing?","number","8"));
if(isNaN(spacing)) {
return;
}
const elements=ea.getViewSelectedElements();
const elements=ea.getViewSelectedElements()
.filter(els => !(els.length === 1 && els[0].type ==="arrow")); // ignore individual arrows
const topGroups = ea.getMaximumGroups(elements);
const groups = topGroups.sort((lha,rha) => lha[0].x - rha[0].x);

View File

@@ -15,7 +15,8 @@ const spacing = parseInt (await utils.inputPrompt("spacing?","number","8"));
if(isNaN(spacing)) {
return;
}
const elements=ea.getViewSelectedElements();
const elements=ea.getViewSelectedElements()
.filter(els => !(els.length === 1 && els[0].type ==="arrow")); // ignore individual arrows
const topGroups = ea.getMaximumGroups(elements);
const groups = topGroups.sort((lha,rha) => lha[0].y - rha[0].y);