From 2430e8f2ab11c97e579aa3da6878f78fe3f2b85a Mon Sep 17 00:00:00 2001 From: Patrick Brosset Date: Wed, 5 Sep 2012 07:59:58 +0200 Subject: [PATCH] fixed bug where deleting first frame was failing --- js/piskel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/piskel.js b/js/piskel.js index 19baa0be..69475438 100644 --- a/js/piskel.js +++ b/js/piskel.js @@ -183,7 +183,8 @@ $.namespace("pskl"); removeFrame: function(frameIndex) { frameSheet.removeFrameByIndex(frameIndex); - this.setActiveFrameAndRedraw(frameIndex - 1); + var activeFrameIndex = frameIndex ? frameIndex - 1 : 0; + this.setActiveFrameAndRedraw(activeFrameIndex); }, duplicateFrame: function(frameIndex) {