mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Fix issue with starting and stopping item based animations.
This commit is contained in:
parent
57227b9ff6
commit
d9eaa3f631
1 changed files with 3 additions and 4 deletions
|
@ -147,12 +147,11 @@ var View = Base.extend(Callback, /** @lends View# */{
|
|||
onFrame: {
|
||||
install: function() {
|
||||
/*#*/ if (options.environment == 'browser') {
|
||||
this._animate = true;
|
||||
// Request a frame handler straight away to initialize the
|
||||
// sequence of onFrame calls.
|
||||
if (!this._requested) {
|
||||
this._animate = true;
|
||||
if (!this._requested)
|
||||
this._requestFrame();
|
||||
}
|
||||
/*#*/ } // options.environment == 'browser'
|
||||
},
|
||||
|
||||
|
@ -174,6 +173,7 @@ var View = Base.extend(Callback, /** @lends View# */{
|
|||
_requestFrame: function() {
|
||||
/*#*/ if (options.environment == 'browser') {
|
||||
var that = this;
|
||||
this._requested = true;
|
||||
DomEvent.requestAnimationFrame(function() {
|
||||
that._requested = false;
|
||||
// Do we need to stop due to a call to the frame event's uninstall()
|
||||
|
@ -183,7 +183,6 @@ var View = Base.extend(Callback, /** @lends View# */{
|
|||
that._requestFrame();
|
||||
that._handleFrame();
|
||||
}, this._element);
|
||||
this._requested = true;
|
||||
/*#*/ } // options.environment == 'browser'
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue