Fix: Drag-Icon in hud.gd auf 48x48 begrenzt (Slot zu Slot)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Andre 2026-03-19 23:10:18 +01:00
parent 341cc491fc
commit 6d3ef11321

9
hud.gd
View file

@ -141,9 +141,7 @@ func _start_actionbar_drag(slot_index: int):
return
drag_icon = TextureRect.new()
drag_icon.texture = current_texture
drag_icon.custom_minimum_size = Vector2(40, 40)
drag_icon.size = Vector2(40, 40)
drag_icon.expand_mode = TextureRect.EXPAND_FIT_WIDTH_PROPORTIONAL
drag_icon.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
drag_icon.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
drag_icon.mouse_filter = Control.MOUSE_FILTER_IGNORE
var drag_layer = CanvasLayer.new()
@ -151,7 +149,10 @@ func _start_actionbar_drag(slot_index: int):
drag_layer.layer = 200
drag_layer.add_child(drag_icon)
get_tree().root.add_child(drag_layer)
drag_icon.position = get_viewport().get_mouse_position() - Vector2(20, 20)
# Größe erst nach add_child setzen
drag_icon.custom_minimum_size = Vector2(48, 48)
drag_icon.size = Vector2(48, 48)
drag_icon.position = get_viewport().get_mouse_position() - Vector2(24, 24)
func _process(_delta):
if drag_from_slot >= 0 and drag_icon: