Skip to content

Commit

Permalink
make sure there is only one rock and roll object
Browse files Browse the repository at this point in the history
  • Loading branch information
biasmv committed Mar 14, 2015
1 parent d4ad81f commit 9e56b76
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,11 @@ Viewer.prototype = {
return this._rockAndRoll !== null;
}
if (!!enable) {
this._rockAndRoll = anim.rockAndRoll();
this._animControl.add(this._rockAndRoll);
this.requestRedraw();
if (this._rockAndRoll === null) {
this._rockAndRoll = anim.rockAndRoll();
this._animControl.add(this._rockAndRoll);
this.requestRedraw();
}
return true;
}
this._animControl.remove(this._rockAndRoll);
Expand Down

0 comments on commit 9e56b76

Please sign in to comment.