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

Update DisplayObject.js #543

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update DisplayObject.js #543

wants to merge 1 commit into from

Conversation

yar3333
Copy link
Contributor

@yar3333 yar3333 commented Dec 26, 2014

Fix: case setBounds(null) (don't do "this._bounds = new createjs.Rectangle" after "this._bounds = null").
Maybe we need also always create new rectangle, not using old _bounds (or always return cloned rectangle from getBounds())?
In my project I got several bugs related to next code:
var boundsToUseLater = myObj.getBounds(); // save current bounds
// some code (change myObj then call getBounds())
// use boundsToUseLater - properties x/y/widht/height not the same as they were the save moment

Fix: case setBounds(null)  (don't do "this._bounds = new createjs.Rectangle" after "this._bounds = null").
Maybe we need also always create new rectangle, not using old _bounds (or always return cloned rectangle from getBounds())?
In my project I got several bugs related to next code:
var boundsToUseLater = myObj.getBounds(); // save current bounds
// some code (change myObj then call getBounds())
// use boundsToUseLater - properties x/y/widht/height not the same as they were the save moment
@JonnyCodes
Copy link

JonnyCodes commented Nov 22, 2017

Shouldn't the bounds be null if any of those properties (x, y, width or height) are null?
Edit: Just seen how old this pull request is!

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

Successfully merging this pull request may close these issues.

2 participants