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

Only bubble up _update if it is called by getBoundingRect. #109

Merged
merged 1 commit into from
Jun 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
var rect;

// TODO: Update this to not __always__ update. Just when it needs to.
this._update();
this._update(true);

// Variables need to be defined here, because of nested nature of groups.
var left = Infinity, right = -Infinity,
Expand Down
2 changes: 1 addition & 1 deletion src/polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
getBoundingClientRect: function(shallow) {

// TODO: Update this to not __always__ update. Just when it needs to.
this._update();
this._update(true);

var matrix = !!shallow ? this._matrix : getComputedMatrix(this);

Expand Down
10 changes: 6 additions & 4 deletions src/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
* To be called before render that calculates and collates all information
* to be as up-to-date as possible for the render. Called once a frame.
*/
_update: function() {
_update: function(deep) {

if (!this._matrix.manual && this._flagMatrix) {
this._matrix
Expand All @@ -125,9 +125,11 @@

}

// Bubble up to parents mainly for `getBoundingClientRect` method.
if (this.parent && this.parent._update) {
this.parent._update();
if (deep) {
// Bubble up to parents mainly for `getBoundingClientRect` method.
if (this.parent && this.parent._update) {
this.parent._update();
}
}

return this;
Expand Down