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

Exception on empty Shape #6

Closed
samreid opened this issue Mar 11, 2013 · 4 comments
Closed

Exception on empty Shape #6

samreid opened this issue Mar 11, 2013 · 4 comments
Assignees

Comments

@samreid
Copy link
Member

samreid commented Mar 11, 2013

A recent change to scenery causes this exception if I create a path with new Shape():
Uncaught Error: Assertion failed: Infinite bounds given to invalidateSelf

Should I be able to create a Shape/Path as an empty shape with new Shape()?

@ghost ghost assigned samreid Mar 11, 2013
@samreid
Copy link
Member Author

samreid commented Mar 11, 2013

In discussion, @jonathanolson said: "I should probably assert( bounds.isEmpty() || bounds.isFinite() )".

I changed the assertion like you recommended and it seems like it solves the problem. Specifically, I changed the assertion that bounds x is finite and not NaN to: must be empty or finite. After this change, I tested qunit and 2516/2516 test passed (in Win8Chrome), so I will push to master.

samreid added a commit that referenced this issue Mar 11, 2013
@ghost ghost assigned jonathanolson Mar 11, 2013
@samreid
Copy link
Member Author

samreid commented Mar 11, 2013

Reassigned to @jonathanolson to verify my change set.

@samreid
Copy link
Member Author

samreid commented Mar 11, 2013

Do we also need to retain the test for NaN in the bounds? Also, the former test that was replaced just checked the x value for NaN (see 93b822f)

@jonathanolson
Copy link
Contributor

isFinite( NaN ) is false, so this should work well. Changeset looks good.

This issue was closed.
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