-
Absolute Layer Possition [toWorld() expression]
Hello,
Im trying to calculate a layer position relative to the world. The reason being is that I want to calculate the distance between two layers and not get interference when one of those layers gets parented.
My Expression seems to work, BUT … it seems that the world position is calculated from the top left corner. I’ve solved that with adding the X and Y from the layers anchor point, but it fails when the layer gets rotated.
To put it in other words. If I have a Layer with position values [960,540], after I parent it I want those values to remain the same, so my distance calculation remains accurate.
Any solutions?
Thank you very much.
Layer = [whateverlayer];A = Layer.toWorld(anchorPoint);
X= A[0] + Layer.anchorPoint[0];
Y= A[1] + Layer.anchorPoint[1];AbsPos = [X,Y];