From 2327b138ebf747bb7d5ac9e720459f2cd9c3c590 Mon Sep 17 00:00:00 2001 From: zahuifan Date: Tue, 8 Mar 2022 20:40:34 +0800 Subject: [PATCH] fix: Text in sticky notes should be ignored --- ea-scripts/Fixed horizontal distance between centers.md | 4 +++- ea-scripts/Fixed inner distance.md | 3 ++- ea-scripts/Fixed spacing.md | 4 +++- ea-scripts/Fixed vertical distance between centers.md | 4 +++- ea-scripts/Fixed vertical distance.md | 4 +++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ea-scripts/Fixed horizontal distance between centers.md b/ea-scripts/Fixed horizontal distance between centers.md index e6a8778..ecbf08b 100644 --- a/ea-scripts/Fixed horizontal distance between centers.md +++ b/ea-scripts/Fixed horizontal distance between centers.md @@ -47,7 +47,9 @@ if(rememberLastDistance) { } const elements=ea.getViewSelectedElements(); const topGroups = ea.getMaximumGroups(elements) - .filter(els => !(els.length === 1 && els[0].type ==="arrow")); // ignore individual arrows + .filter(els => !(els.length === 1 && els[0].type ==="arrow")) // ignore individual arrows + .filter(els => !(els.length === 1 && (els[0].containerId))); // ignore text in stickynote + const groups = topGroups.sort((lha,rha) => lha[0].x - rha[0].x); for(var i=0; i !(els.length === 1 && els[0].type ==="arrow")); // ignore individual arrows + .filter(els => !(els.length === 1 && els[0].type ==="arrow")) // ignore individual arrows + .filter(els => !(els.length === 1 && (els[0].containerId))); // ignore text in stickynote if(topGroups.length <= 1) { new Notice("At least 2 or more elements or groups should be selected."); diff --git a/ea-scripts/Fixed spacing.md b/ea-scripts/Fixed spacing.md index bc58c37..49b66ca 100644 --- a/ea-scripts/Fixed spacing.md +++ b/ea-scripts/Fixed spacing.md @@ -46,7 +46,9 @@ if(rememberLastSpacing) { } const elements=ea.getViewSelectedElements(); const topGroups = ea.getMaximumGroups(elements) - .filter(els => !(els.length === 1 && els[0].type ==="arrow")); // ignore individual arrows + .filter(els => !(els.length === 1 && els[0].type ==="arrow")) // ignore individual arrows + .filter(els => !(els.length === 1 && (els[0].containerId))); // ignore text in stickynote + const groups = topGroups.sort((lha,rha) => lha[0].x - rha[0].x); for(var i=0; i !(els.length === 1 && els[0].type ==="arrow")); // ignore individual arrows + .filter(els => !(els.length === 1 && els[0].type ==="arrow")) // ignore individual arrows + .filter(els => !(els.length === 1 && (els[0].containerId))); // ignore text in stickynote + const groups = topGroups.sort((lha,rha) => lha[0].y - rha[0].y); for(var i=0; i !(els.length === 1 && els[0].type ==="arrow")); // ignore individual arrows + .filter(els => !(els.length === 1 && els[0].type ==="arrow")) // ignore individual arrows + .filter(els => !(els.length === 1 && (els[0].containerId))); // ignore text in stickynote + const groups = topGroups.sort((lha,rha) => lha[0].y - rha[0].y); for(var i=0; i