diff --git a/src/Tools/Move.gd b/src/Tools/Move.gd index aecac5756..ea8ec7fbd 100644 --- a/src/Tools/Move.gd +++ b/src/Tools/Move.gd @@ -28,6 +28,8 @@ func _input(event : InputEvent) -> void: func draw_start(position : Vector2) -> void: + if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn(): + return _start_pos = position _offset = position _undo_data = _get_undo_data() @@ -37,6 +39,8 @@ func draw_start(position : Vector2) -> void: func draw_move(position : Vector2) -> void: + if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn(): + return # This is true if content transformation has been confirmed (pressed Enter for example) # while the content is being moved if _content_transformation_check != selection_node.is_moving_content: @@ -59,6 +63,8 @@ func draw_move(position : Vector2) -> void: func draw_end(position : Vector2) -> void: + if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn(): + return if _start_pos != Vector2.INF and _content_transformation_check == selection_node.is_moving_content: if Tools.shift: # Snap to axis var angle := position.angle_to_point(_start_pos) diff --git a/src/Tools/SelectionTools/SelectionTool.gd b/src/Tools/SelectionTools/SelectionTool.gd index dde613f17..a0f259cbb 100644 --- a/src/Tools/SelectionTools/SelectionTool.gd +++ b/src/Tools/SelectionTools/SelectionTool.gd @@ -75,6 +75,8 @@ func draw_start(position : Vector2) -> void: if selection_position.y < 0: offsetted_pos.y -= selection_position.y if offsetted_pos.x >= 0 and offsetted_pos.y >= 0 and project.selection_bitmap.get_bit(offsetted_pos) and (!Tools.control or Tools.alt) and !Tools.shift and !_ongoing_selection: + if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn(): + return # Move current selection _move = true if Tools.alt: # Move selection without content diff --git a/src/UI/Canvas/Selection.gd b/src/UI/Canvas/Selection.gd index b4f25047a..2dd58fec2 100644 --- a/src/UI/Canvas/Selection.gd +++ b/src/UI/Canvas/Selection.gd @@ -105,6 +105,8 @@ func _input(event : InputEvent) -> void: Global.main_viewport.mouse_default_cursor_shape = Input.CURSOR_CROSS if event is InputEventMouseButton and event.button_index == BUTTON_LEFT: + if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn(): + return if event.pressed: if gizmo: Global.has_focus = false @@ -165,6 +167,8 @@ func move_with_arrow_keys(event : InputEvent) -> void: return if Global.current_project.has_selection: + if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn(): + return if is_action_direction_pressed(event) and !arrow_key_move: arrow_key_move = true if Input.is_key_pressed(KEY_ALT):