Introduce View#_redraw() and use it in #setViewSize() and #_transform().

This commit is contained in:
Jürg Lehni 2011-08-22 11:14:38 +02:00
parent 3ca165f413
commit b54f9f2228

View file

@ -161,11 +161,23 @@ var View = this.View = PaperScopeItem.extend(/** @lends View# */{
return true;
},
_redraw: function() {
if (this._onFrameCallback) {
// If there's a _onFrameCallback, call it staight away,
// but without requesting another animation frame.
this._onFrameCallback(0, true);
} else {
// Otherwise simply redraw the view now
this.draw(true);
}
},
_transform: function(matrix, flags) {
this._matrix.preConcatenate(matrix);
// Force recalculation of these values next time they are requested.
this._bounds = null;
this._inverse = null;
this._redraw();
},
/**
@ -208,14 +220,7 @@ var View = this.View = PaperScopeItem.extend(/** @lends View# */{
delta: delta
});
}
if (this._onFrameCallback) {
// If there's a _onFrameCallback, call it staight away,
// but without requesting another animation frame.
this._onFrameCallback(0, true);
} else {
// Otherwise simply redraw the view now
this.draw(true);
}
this._redraw();
},
/**