From 1ae34bf57abd1688eb46d43ee027266585c91cf5 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:31:04 +0300 Subject: [PATCH] Use an anchor and offset preset for the CollapsibleContainer's texture rect --- src/UI/Nodes/CollapsibleContainer.gd | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/UI/Nodes/CollapsibleContainer.gd b/src/UI/Nodes/CollapsibleContainer.gd index 61bf7dc96..d311e8b0c 100644 --- a/src/UI/Nodes/CollapsibleContainer.gd +++ b/src/UI/Nodes/CollapsibleContainer.gd @@ -33,12 +33,9 @@ func _ready() -> void: _button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND _button.toggled.connect(set_visible_children) add_child(_button, false, Node.INTERNAL_MODE_FRONT) - _texture_rect.anchor_top = 0.5 - _texture_rect.anchor_bottom = 0.5 - _texture_rect.offset_left = 2 - _texture_rect.offset_top = -6 - _texture_rect.offset_right = 14 - _texture_rect.offset_bottom = 6 + _texture_rect.set_anchors_and_offsets_preset( + Control.PRESET_CENTER_LEFT, Control.PRESET_MODE_MINSIZE + ) _texture_rect.rotation_degrees = -90 _texture_rect.pivot_offset = Vector2(6, 6) _texture_rect.add_to_group("UIButtons")