Skip to content

Instantly share code, notes, and snippets.

@AEnMe
Last active September 24, 2020 14:44
Show Gist options
  • Save AEnMe/4a11a8d2538b4d2410fcd91ceb62f02c to your computer and use it in GitHub Desktop.
Save AEnMe/4a11a8d2538b4d2410fcd91ceb62f02c to your computer and use it in GitHub Desktop.
Stabilize the scale through parentings
/* 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