cards and posts will pass mouse events even when they are not draggable

This commit is contained in:
betalars 2023-07-18 14:58:06 +02:00
parent f507b9b890
commit 9b632bdf8e
2 changed files with 4 additions and 3 deletions

View File

@ -143,9 +143,10 @@ func _on_input_event(viewport, event, shape_idx):
if event is InputEventMouseButton: if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT: 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) 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(): func _move_card():
if is_dragged: if is_dragged:

View File

@ -96,7 +96,7 @@ func _on_input_event(viewport, event, shape_idx):
if event is InputEventMouseButton: if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT: 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) mouse_offset = (get_viewport().get_mouse_position() - global_position)
owner.handle_mouse_button(self, event) owner.handle_mouse_button(self, event)