Skip to content

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