Set the edited resource's rect after drag.

This commit is contained in:
Relintai 2021-12-25 01:51:35 +01:00
parent d07f9c4949
commit 6c438c97f4
2 changed files with 6 additions and 4 deletions

View File

@ -5,25 +5,25 @@
[sub_resource type="Resource" id=1]
script = ExtResource( 2 )
rect = Rect2( 0, 0, 100, 100 )
rect = Rect2( 133, 63, 224, 158 )
locked = false
zones = [ ]
[sub_resource type="Resource" id=2]
script = ExtResource( 2 )
rect = Rect2( 0, 0, 1, 1 )
rect = Rect2( 107, 271, 100, 49 )
locked = false
zones = [ ]
[sub_resource type="Resource" id=3]
script = ExtResource( 2 )
rect = Rect2( 0, 0, 1, 1 )
rect = Rect2( 498, 185, 100, 100 )
locked = false
zones = [ ]
[sub_resource type="Resource" id=4]
script = ExtResource( 2 )
rect = Rect2( 0, 0, 1, 1 )
rect = Rect2( 522, 29, 63, 54 )
locked = false
zones = [ ]

View File

@ -124,6 +124,8 @@ func _gui_input(p_event : InputEvent) -> void:
set_size(rect.size)
set_position(rect.position)
edited_resource.set_rect(rect)
#based on / ported from engine/scene/gui/dialogs.h and .cpp
func _drag_hit_test(pos : Vector2) -> int: