mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Introduce View#_redraw() and use it in #setViewSize() and #_transform().
This commit is contained in:
parent
3ca165f413
commit
b54f9f2228
1 changed files with 13 additions and 8 deletions
|
@ -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();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue