Jump to content
GreenSock

JohnD

Persist x,y,scaleX,scaleY,width,height,rotation? [SOLVED]

Recommended Posts

I try to persist the width,height,rotation,x,y,scaleX and scaleY of a transformed object.

Problem is when I set these values to a fresh object, they wont stick.

 

The core problem is if I do:

 

dobj.width=125.5;

dobj.height=125.5;

dobj.rotation=-17.55911975406459;

dobj.x=181.25;

dobj.y=111.4;

dobj.scaleX=0.9999999901252807;

dobj.scaleY=0.9999999901252807;

 

And then immediately trace these properties, they're not the same:

 

dobj.width=157.35000000000002;

dobj.height=157.4;

dobj.rotation=-17.53193678694493;

dobj.x=181.2;

dobj.y=111.35;

dobj.scaleX=0.9990430805040824;

dobj.scaleY=0.9990430805040824;

 

Why is this and how can I set the values to be what I intend?

 

Best regards

/John

Link to comment
Share on other sites

Solved it by using transform.matrix instead.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×