Skip to content

Commit

Permalink
Notify invalidation listeners when a Shape is made immutable. See phe…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Sep 28, 2016
1 parent d6d95bd commit c2cf466
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion js/Shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@ define( function( require ) {
makeImmutable: function() {
this._immutable = true;

this.notifyInvalidationListeners();

return this; // for chaining
},

Expand Down Expand Up @@ -1232,10 +1234,18 @@ define( function( require ) {
if ( !this._invalidatingPoints ) {
this._bounds = null;

this.trigger0( 'invalidated' );
this.notifyInvalidationListeners();
}
},

/**
* Called when a part of the Shape has changed, or if metadata on the Shape has changed (e.g. it became immutable).
* @private
*/
notifyInvalidationListeners: function() {
this.trigger0( 'invalidated' );
},

/**
* @private
*/
Expand Down

0 comments on commit c2cf466

Please sign in to comment.