Fixed animation preview when deleting

This commit is contained in:
juliandescottes
2012-09-05 00:42:25 +02:00
19 changed files with 228 additions and 193 deletions

View File

@ -65,12 +65,17 @@
}
};
ns.FrameSheet.prototype.hasFrameAtIndex = function(index) {
return (index >= 0 && index < this.getFrameCount());
};
ns.FrameSheet.prototype.getFrameByIndex = function(index) {
if (isNaN(index)) {
throw "Bad argument value for getFrameByIndex method: <" + index + ">";
}
if (index < 0 || index > this.getFrameCount()) {
if (!this.hasFrameAtIndex(index)) {
throw "Out of bound index for frameSheet object.";
}
@ -78,10 +83,10 @@
};
ns.FrameSheet.prototype.removeFrameByIndex = function(index) {
if(index < 0 || index > this.getFrameCount()) {
if(!this.hasFrameAtIndex(index)) {
throw "Out of bound index for frameSheet object.";
}
frames.splice(index, 1);
this.frames.splice(index, 1);
};
ns.FrameSheet.prototype.duplicateFrameByIndex = function(index) {