Issue#148:JSError when deleting first frame + preview speed accuracy

This commit is contained in:
jdescottes 2013-12-19 00:15:40 +01:00
parent 4056142b97
commit f98c2d2cf5
2 changed files with 2 additions and 6 deletions

View File

@ -98,7 +98,7 @@
l.removeFrameAt(index);
});
// Current frame index is impacted if the removed frame was before the current frame
if (this.currentFrameIndex >= index) {
if (this.currentFrameIndex >= index && this.currentFrameIndex > 0) {
this.setCurrentFrameIndex(this.currentFrameIndex - 1);
}

View File

@ -6,7 +6,6 @@
this.isRunning = false;
this.previousTime = 0;
this.callbacks = [];
this.i = 0;
};
ns.DrawingLoop.prototype.addCallback = function (callback, scope, args) {
@ -34,10 +33,7 @@
ns.DrawingLoop.prototype.loop_ = function () {
var currentTime = Date.now();
var delta = currentTime - this.previousTime;
this.i++;
if(this.i%2 === 0) {
this.executeCallbacks_(delta);
}
this.previousTime = currentTime;
this.requestAnimationFrame.call(window, this.loop_.bind(this));
};