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

Width returns 0 #138

Closed
kerissakti opened this issue Aug 1, 2015 · 4 comments
Closed

Width returns 0 #138

kerissakti opened this issue Aug 1, 2015 · 4 comments

Comments

@kerissakti
Copy link

After pulling to the latest git. I found a problem with getting a shape's width

loadingBarContainer = new ShapeEx();
loadingBarContainer.graphics.lineStyle(4,0xffffff);
loadingBarContainer.graphics.drawRect(0, 0, 400, 10);
container.addChild(loadingBarContainer);

when I call loadingBarContainer.width, this usually returns 400 but now it always returns 0

@IonSwitz
Copy link
Member

IonSwitz commented Aug 1, 2015

Ah, I'm sure this is a problem with the change to making the Graphic base class a DisplayObjectContainer rather than a DisplayObject. I will investigate, and I am really sorry.

IonSwitz added a commit that referenced this issue Aug 1, 2015
Fixing bad code for
#138
, also, updating some variable names for invalid states, allowing faster
changes to geometry only, without need to re-create vertex buffers
@IonSwitz
Copy link
Member

IonSwitz commented Aug 1, 2015

First off: THANK YOU for the easy reproduction case. That really helps :)

Secondly: I have found the bug and I have submited the fix, but are you sure it returned 400 before? It should return 404, since the thickness of the line is 4. The width should be (from left to right) "half Thickness" + total width + "half thickness", ie 2 + 400 + 2.

I have uploaded the fix, but please get back to me about the width. If it used to return 400, that was a bug, I would think.

Also, please, keep an eye out for other mistakes that can have happened due to the change mentioned above, I would really appreciate the assistance

@kerissakti
Copy link
Author

Ups, yes you were right, it returned 404 and not 400. Thanks for fixing it so quickly

@IonSwitz
Copy link
Member

IonSwitz commented Aug 1, 2015

Also, I realized that the bug above was just the tip of the iceberg. I will go back to having the Graphic class extending DisplayObject, and not DisplayObjectContainer. That caused more headaches then I wanted

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