Last active
September 24, 2020 14:44
-
-
Save AEnMe/4a11a8d2538b4d2410fcd91ceb62f02c to your computer and use it in GitHub Desktop.
Stabilize the scale through parentings
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
/* To keep the same scale */ | |
L=thisLayer; | |
s=transform.scale.value; | |
while(L.hasParent){ | |
L=L.parent; | |
for(i=0;i<s.length;i++) // Apply it on the array | |
s[i] *= 100/L.scale.value[i]; | |
} | |
s | |
///////////// | |
/* To keep the same stroke width */ | |
L=thisLayer; | |
s=transform.scale.value[0]; | |
while(L.hasParent){ | |
L=L.parent; | |
s /= 100/L.scale.value[0]; | |
} | |
(s==0)?0:Math.abs(value/s*100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment