You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling set_drag_preview() from a Control nested within an embedded PopupPanel will cause the preview to be clipped by that PopupPanel.
Seems possible that #64949 might fix this by allowing us to set the parent to the main viewport, but I don't understand the issue well enough to be sure about that.
Steps to reproduce
Some Controls nested within a PopupPanel:
The GridContainer in the image above has a script that instantiates each inventory slot as a scene, which looks like this:
The InventorySlotControl's script contains the following code:
func _get_drag_data(_position: Vector2):
if item_stack is ItemStack:
drag_data = { "item_stack": item_stack, "previous_slot": self }
set_drag_preview(stack_container.duplicate())
stack_taken.emit(get_index())
return drag_data
func _can_drop_data(_position: Vector2, data) -> bool:
return data is Dictionary and data.has("item_stack")
func _drop_data(_position: Vector2, data) -> void:
stack_received.emit(get_index(), data)
data.previous_slot.drag_data = null
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_released("ui_left_mouse") and drag_data is Dictionary:
accept_event()
stack_received.emit(get_index(), drag_data)
drag_data = null
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered:
Godot version
4.0.beta2
System information
Windows 10
Issue description
Calling set_drag_preview() from a Control nested within an embedded PopupPanel will cause the preview to be clipped by that PopupPanel.
Seems possible that #64949 might fix this by allowing us to set the parent to the main viewport, but I don't understand the issue well enough to be sure about that.
Steps to reproduce
Some Controls nested within a PopupPanel:
The GridContainer in the image above has a script that instantiates each inventory slot as a scene, which looks like this:
The InventorySlotControl's script contains the following code:
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: