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) {
|
ns.DrawingController.prototype.onTouchstart_ = function (event) {
|
||||||
|
var index = this.piskelController.getCurrentLayerIndex();
|
||||||
|
var layer = this.piskelController.getLayerByIndex(index);
|
||||||
|
if (layer.locked) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.onMousedown_(event);
|
this.onMousedown_(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -153,6 +158,11 @@
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ns.DrawingController.prototype.onMousedown_ = function (event) {
|
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]);
|
$.publish(Events.MOUSE_EVENT, [event, this]);
|
||||||
var frame = this.piskelController.getCurrentFrame();
|
var frame = this.piskelController.getCurrentFrame();
|
||||||
var coords = this.getSpriteCoordinates(event.clientX, event.clientY);
|
var coords = this.getSpriteCoordinates(event.clientX, event.clientY);
|
||||||
|
@ -16,6 +16,9 @@ ns.ToolsHelper = {
|
|||||||
var currentFrameIndex = pskl.app.piskelController.getCurrentFrameIndex();
|
var currentFrameIndex = pskl.app.piskelController.getCurrentFrameIndex();
|
||||||
var layers = useAllLayers ? pskl.app.piskelController.getLayers() : [pskl.app.piskelController.getCurrentLayer()];
|
var layers = useAllLayers ? pskl.app.piskelController.getLayers() : [pskl.app.piskelController.getCurrentLayer()];
|
||||||
return layers.reduce(function (previous, layer) {
|
return layers.reduce(function (previous, layer) {
|
||||||
|
if (layer.locked) {
|
||||||
|
return previous;
|
||||||
|
}
|
||||||
var frames = useAllFrames ? layer.getFrames() : [layer.getFrameAt(currentFrameIndex)];
|
var frames = useAllFrames ? layer.getFrames() : [layer.getFrameAt(currentFrameIndex)];
|
||||||
return previous.concat(frames);
|
return previous.concat(frames);
|
||||||
}, []);
|
}, []);
|
||||||
|
Loading…
Reference in New Issue
Block a user