From d55024d503a332baeffb7778a2774f6b9a0e0da6 Mon Sep 17 00:00:00 2001 From: Joren Dandois Date: Sat, 4 Jul 2020 02:45:32 +0200 Subject: [PATCH] Disable drawing of any type when locked --- src/js/controller/drawing/DragHandler.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/controller/drawing/DragHandler.js b/src/js/controller/drawing/DragHandler.js index f3b134d7..7f9a90ec 100644 --- a/src/js/controller/drawing/DragHandler.js +++ b/src/js/controller/drawing/DragHandler.js @@ -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); };