From 17ca359b3b44200576a958eac5a0e1001bba0c92 Mon Sep 17 00:00:00 2001 From: betalars Date: Tue, 18 Jul 2023 14:58:06 +0200 Subject: [PATCH] cards and posts will pass mouse events even when they are not draggable --- src/logic-scenes/board/card.gd | 5 +++-- src/logic-scenes/board/post-it.gd | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/logic-scenes/board/card.gd b/src/logic-scenes/board/card.gd index 4809623a..051e9ed9 100644 --- a/src/logic-scenes/board/card.gd +++ b/src/logic-scenes/board/card.gd @@ -143,9 +143,10 @@ func _on_input_event(viewport, event, shape_idx): if event is InputEventMouseButton: if event.button_index == MOUSE_BUTTON_LEFT: - if is_dragable and "handle_mouse_button" in owner: + if "handle_mouse_button" in owner: mouse_offset = (get_viewport().get_mouse_position() - position) - if highlighted: owner.handle_mouse_button(self, event) + if highlighted: + owner.handle_mouse_button(self, event) func _move_card(): if is_dragged: diff --git a/src/logic-scenes/board/post-it.gd b/src/logic-scenes/board/post-it.gd index ece9ecb2..5468818d 100644 --- a/src/logic-scenes/board/post-it.gd +++ b/src/logic-scenes/board/post-it.gd @@ -96,7 +96,7 @@ func _on_input_event(viewport, event, shape_idx): if event is InputEventMouseButton: if event.button_index == MOUSE_BUTTON_LEFT: - if is_dragable and "handle_mouse_button" in owner: + if "handle_mouse_button" in owner: mouse_offset = (get_viewport().get_mouse_position() - global_position) owner.handle_mouse_button(self, event)