fix #185: create new Panel when all panels are empty

This commit is contained in:
betalars 2025-06-02 23:51:42 +02:00
parent 33b31bb5cd
commit a06e002052
1 changed files with 9 additions and 3 deletions

View File

@ -224,9 +224,15 @@ func handle_mouse_button(input: InputEventMouseButton, to_handle = currently_act
to_handle = area.exchange_sticky_note_with(to_handle) to_handle = area.exchange_sticky_note_with(to_handle)
to_handle.reparent(dropzone) to_handle.reparent(dropzone)
to_handle.on_board = true to_handle.on_board = true
# FIXME: this caused an error when all stickies were attatched ... if sticky_note_container.get_child_count() > 0:
sticky_note_container.get_child(current_sticky_note_id).attached_sticky_note = to_handle sticky_note_container.get_child(current_sticky_note_id).attached_sticky_note = to_handle
to_handle.attached_to = sticky_note_container.get_child(current_sticky_note_id) to_handle.attached_to = sticky_note_container.get_child(current_sticky_note_id)
else:
var new_panel = StickyNotePanel.new()
sticky_note_container.add_child(new_panel, true, Node.INTERNAL_MODE_DISABLED)
new_panel.owner = self
new_panel.attatch_sticky_note(to_handle, self, false)
current_sticky_note_id = 0
to_handle.reset_drag() to_handle.reset_drag()
current_context = NAVIGATE current_context = NAVIGATE
_return_sticky_notes_to_panels() _return_sticky_notes_to_panels()