Disable drawing of any type when locked

This commit is contained in:
Joren Dandois 2020-07-04 02:45:32 +02:00
parent aff1f7ccb6
commit d55024d503

View File

@ -25,6 +25,11 @@
* @param {Number} y : y coordinate of the mouse event that initiated the drag
*/
ns.DragHandler.prototype.startDrag = function (x, y) {
var index = this.piskelController.getCurrentLayerIndex();
var layer = this.piskelController.getLayerByIndex(index);
if (layer.locked) {
return;
}
var coords = this.drawingController.getSpriteCoordinates(x, y);
this.updateOrigin_(coords.x, coords.y);
};