mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Merge branch 'master' into feature-shift-frame
This commit is contained in:
commit
5b4074fc38
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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 () {
|
||||
|
@ -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_()) {
|
||||
|
Loading…
Reference in New Issue
Block a user