Skip to content

Instantly share code, notes, and snippets.

@AlexeyNik
Last active July 20, 2020 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexeyNik/76627d384007b0b4361c714715687442 to your computer and use it in GitHub Desktop.
Save AlexeyNik/76627d384007b0b4361c714715687442 to your computer and use it in GitHub Desktop.
function removeGuidesfromGroup(item) {
var el, el1;
var one = true;
for (var p = 0; p < item.length; p++) {
if (!item[p].guides) {
if (item[p].typename == 'GroupItem') {
one = false;
el = removeGuidesfromGroup(item[p].pageItems)
} else {
el = item[p].geometricBounds;
}
if (one) {
one = false;
el1 = el;
}
if (el1[0] > el[0]) el1[0] = el[0];
if (el1[1] < el[1]) el1[1] = el[1];
if (el1[2] < el[2]) el1[2] = el[2];
if (el1[3] > el[3]) el1[3] = el[3];
}
}
return el1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment