Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML5 target display object get_width / height broken #753

Closed
KnightMearh opened this issue Jul 16, 2015 · 4 comments
Closed

HTML5 target display object get_width / height broken #753

KnightMearh opened this issue Jul 16, 2015 · 4 comments

Comments

@KnightMearh
Copy link

I have tracked this issue to openfl 3.1.2 specifically. When doing a simple check while dragging an object around the screen to detect if it leaves an area, I noticed the object was no longer updating its position (immediately after updating to openfl 3.1.2 from 3.1.1).

Further investigation shows that if myObj.width (or height) is called anywhere (even in a trace) that object fails to update its position. Refer to this simplified example.

//called every frame
myObj.x = mouseX; //update obj x coord to track mouse x

if( myObj.x - myObj.width < 0 ) //offscreen left
{ //do something }

Simply calling myObj.width (even inside a trace) causes myObj to fail to update its x position, so it stops dragging altogether if width is ever called on it.

@KnightMearh
Copy link
Author

Also want to mention that the numbers get_width and get_height return are accurate, it's just that calling either of these properties results in the object itself becoming unmovable.

@jgranick
Copy link
Member

If you trace myObj.x does it return the value you expect? I'm wondering if this is rendering or logic related, thanks 😄

@KnightMearh
Copy link
Author

Good call, the x/y positions are updating correctly when I trace them, but the visual element doesn't move at all.

@jgranick
Copy link
Member

Thank you! I was able to find a solution to this, there were scrollRect changes (improvements) recently that adjusted how some of the matrix transforms behave. This was one last place that hadn't been updated 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants