Доработка. Вертикальный элемент для режима "Контроль" не запоминает свой размер

This commit is contained in:
sasha80
2023-12-21 11:30:29 +03:00
parent c099b2c9e5
commit e4f31521fa
2 changed files with 23 additions and 7 deletions

View File

@@ -169,10 +169,11 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="ref_A1" parent="ref_ZZ0" instance=ExtResource("3_2shxq")]
offset_left = 7.0
offset_left = 12.0
offset_top = 5.0
offset_right = 57.0
offset_bottom = 155.0
self_size = Vector2i(45, 150)
fname = "ИП5-25"
rname = "A1"
@@ -180,7 +181,8 @@ rname = "A1"
offset_left = 56.0
offset_top = 5.0
offset_right = 106.0
offset_bottom = 155.0
offset_bottom = 148.0
self_size = Vector2i(50, 143)
fname = "ЯУ-07Б"
rname = "A2"
@@ -188,7 +190,8 @@ rname = "A2"
offset_left = 102.0
offset_top = 5.0
offset_right = 152.0
offset_bottom = 155.0
offset_bottom = 148.0
self_size = Vector2i(50, 143)
fname = "ЭМС-Г"
rname = "A3"
@@ -196,7 +199,8 @@ rname = "A3"
offset_left = 147.0
offset_top = 5.0
offset_right = 197.0
offset_bottom = 155.0
offset_bottom = 148.0
self_size = Vector2i(50, 143)
fname = "УГ"
rname = "A4"
@@ -204,7 +208,8 @@ rname = "A4"
offset_left = 192.0
offset_top = 5.0
offset_right = 242.0
offset_bottom = 155.0
offset_bottom = 148.0
self_size = Vector2i(50, 143)
fname = "УКП"
rname = "A5"
@@ -212,7 +217,8 @@ rname = "A5"
offset_left = 237.0
offset_top = 4.0
offset_right = 287.0
offset_bottom = 154.0
offset_bottom = 146.0
self_size = Vector2i(50, 142)
fname = "УКП"
rname = "A6"

View File

@@ -17,6 +17,15 @@ extends Control
@export var textures: Array[Texture]
@export var self_size: Vector2i = Vector2i(50, 150):
set(v):
self_size = v
size = v
$np_rect.size = v
_resize_children()
get: return size
@export var fname: String:
set(v):
fname = v
@@ -40,12 +49,13 @@ func _resize_children() -> void:
func _on_nine_patch_rect_resized() -> void:
size = $np_rect.size
self_size = $np_rect.size
_resize_children()
func _on_resized() -> void:
$np_rect.size = size
self_size = size
_resize_children()