From f98c2d2cf594d3af7b705b21275baf30d484ef4b Mon Sep 17 00:00:00 2001 From: jdescottes Date: Thu, 19 Dec 2013 00:15:40 +0100 Subject: [PATCH 1/2] Issue#148:JSError when deleting first frame + preview speed accuracy --- js/controller/PiskelController.js | 2 +- js/rendering/DrawingLoop.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/js/controller/PiskelController.js b/js/controller/PiskelController.js index 25028ce7..ab44d197 100644 --- a/js/controller/PiskelController.js +++ b/js/controller/PiskelController.js @@ -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); } diff --git a/js/rendering/DrawingLoop.js b/js/rendering/DrawingLoop.js index d746f684..e1816011 100644 --- a/js/rendering/DrawingLoop.js +++ b/js/rendering/DrawingLoop.js @@ -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.executeCallbacks_(delta); this.previousTime = currentTime; this.requestAnimationFrame.call(window, this.loop_.bind(this)); }; From e8d96bf73f9af61faa44386ecc1bec9333a94872 Mon Sep 17 00:00:00 2001 From: jdescottes Date: Sun, 9 Feb 2014 20:56:45 +0100 Subject: [PATCH 2/2] Fix : added missing Method on BaseSelect - TODO : Review usage of hideHighlightedPixel in Tools --- js/drawingtools/selectiontools/BaseSelect.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/drawingtools/selectiontools/BaseSelect.js b/js/drawingtools/selectiontools/BaseSelect.js index 19972394..3ed29870 100644 --- a/js/drawingtools/selectiontools/BaseSelect.js +++ b/js/drawingtools/selectiontools/BaseSelect.js @@ -89,6 +89,10 @@ } }; + ns.BaseSelect.prototype.hideHighlightedPixel = function() { + // there is no highlighted pixel for selection tools, do nothing + }; + /** * For each pixel in the selection draw it in white transparent on the tool overlay * @protected