Have subclasses of Item call the base version of _changed().

This commit is contained in:
Jürg Lehni 2011-06-19 22:40:49 +01:00
parent a50f6a23ac
commit 7a90f9260e
2 changed files with 4 additions and 2 deletions

View file

@ -75,6 +75,8 @@ var Group = this.Group = Item.extend({
},
_changed: function(flags) {
// Don't use base() for reasons of performance.
Item.prototype._changed.call(this, flags);
if (flags & (ChangeFlag.HIERARCHY | ChangeFlag.CLIPPING)) {
// Clear cached clip item whenever hierarchy changes
delete this._clipItem;

View file

@ -60,9 +60,9 @@ var Path = this.Path = PathItem.extend({
},
_changed: function(flags) {
// Don't use base() for reasons of performance.
Item.prototype._changed.call(this, flags);
if (flags & ChangeFlag.GEOMETRY) {
delete this._bounds;
delete this._position;
delete this._strokeBounds;
delete this._length;
// Clockwise state becomes undefined as soon as geometry changes.