Added missing preview when dragging nodes from menu to quick buttons

This commit is contained in:
Rodz Labs 2021-11-25 21:24:42 +01:00
parent b07d24601c
commit 006af9d03f
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ func set_icon(icon: Texture) -> void:
$HBoxContainer/HBoxContainer/Icon.texture = icon
func get_drag_data(position):
var texture_rect : TextureRect = TextureRect.new()
texture_rect.texture = $HBoxContainer/HBoxContainer/Icon.texture
texture_rect.rect_scale = Vector2(0.35, 0.35)
set_drag_preview(texture_rect)
if path == "":
return $HBoxContainer/HBoxContainer/Name.text
else: