fixed bug where deleting first frame was failing

This commit is contained in:
Patrick Brosset 2012-09-05 07:59:58 +02:00
parent 3b70ce1c17
commit 2430e8f2ab

View File

@ -183,7 +183,8 @@ $.namespace("pskl");
removeFrame: function(frameIndex) { removeFrame: function(frameIndex) {
frameSheet.removeFrameByIndex(frameIndex); frameSheet.removeFrameByIndex(frameIndex);
this.setActiveFrameAndRedraw(frameIndex - 1); var activeFrameIndex = frameIndex ? frameIndex - 1 : 0;
this.setActiveFrameAndRedraw(activeFrameIndex);
}, },
duplicateFrame: function(frameIndex) { duplicateFrame: function(frameIndex) {