mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Disable move when locked
Disable shift move when locked
This commit is contained in:
parent
a4d3d441db
commit
aff1f7ccb6
@ -137,6 +137,11 @@
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.onTouchstart_ = function (event) {
|
||||
var index = this.piskelController.getCurrentLayerIndex();
|
||||
var layer = this.piskelController.getLayerByIndex(index);
|
||||
if (layer.locked) {
|
||||
return;
|
||||
}
|
||||
this.onMousedown_(event);
|
||||
};
|
||||
|
||||
@ -153,6 +158,11 @@
|
||||
* @private
|
||||
*/
|
||||
ns.DrawingController.prototype.onMousedown_ = function (event) {
|
||||
var index = this.piskelController.getCurrentLayerIndex();
|
||||
var layer = this.piskelController.getLayerByIndex(index);
|
||||
if (layer.locked) {
|
||||
return;
|
||||
}
|
||||
$.publish(Events.MOUSE_EVENT, [event, this]);
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
var coords = this.getSpriteCoordinates(event.clientX, event.clientY);
|
||||
|
@ -16,6 +16,9 @@ ns.ToolsHelper = {
|
||||
var currentFrameIndex = pskl.app.piskelController.getCurrentFrameIndex();
|
||||
var layers = useAllLayers ? pskl.app.piskelController.getLayers() : [pskl.app.piskelController.getCurrentLayer()];
|
||||
return layers.reduce(function (previous, layer) {
|
||||
if (layer.locked) {
|
||||
return previous;
|
||||
}
|
||||
var frames = useAllFrames ? layer.getFrames() : [layer.getFrameAt(currentFrameIndex)];
|
||||
return previous.concat(frames);
|
||||
}, []);
|
||||
|
Loading…
Reference in New Issue
Block a user