Last active
July 20, 2020 04:10
-
-
Save AlexeyNik/76627d384007b0b4361c714715687442 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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