Merge branch 'master' into feature-shift-frame

This commit is contained in:
jdescottes 2014-05-17 11:11:29 +02:00
commit 5b4074fc38
3 changed files with 14 additions and 9 deletions

View File

@ -224,11 +224,13 @@
this.selectLayer(layer);
};
ns.PiskelController.prototype.removeCurrentLayer = function () {
ns.PiskelController.prototype.removeLayerAt = function (index) {
if (this.getLayers().length > 1) {
var layer = this.getCurrentLayer();
this.piskel.removeLayer(layer);
this.setCurrentLayerIndex(0);
var layer = this.getLayerAt(index);
if (layer) {
this.piskel.removeLayer(layer);
this.setCurrentLayerIndex(0);
}
}
};

View File

@ -123,13 +123,14 @@
};
ns.PublicPiskelController.prototype.removeCurrentLayer = function () {
this.raiseSaveStateEvent_(this.piskelController.removeCurrentLayer, []);
this.piskelController.removeCurrentLayer();
var currentLayerIndex = this.getCurrentLayerIndex();
this.raiseSaveStateEvent_(this.piskelController.removeLayerAt, [currentLayerIndex]);
this.piskelController.removeLayerAt(currentLayerIndex);
$.publish(Events.PISKEL_RESET);
};
ns.PublicPiskelController.prototype.getCurrentLayerIndex = function () {
return this.piskelController.currentLayerIndex;
return this.piskelController.getCurrentLayerIndex();
};
ns.PublicPiskelController.prototype.getCurrentFrameIndex = function () {

View File

@ -110,8 +110,10 @@
this.replayState(state);
}
var lastState = this.stateQueue[index];
this.setupState(lastState);
var lastState = this.stateQueue[index+1];
if (lastState) {
this.setupState(lastState);
}
this.currentIndex = index;
$.publish(Events.PISKEL_RESET);
if (originalSize !== this.getPiskelSize_()) {