mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-25 14:19:19 +01:00
Properly handle horizontal minimum in the flex grid container.
This commit is contained in:
parent
b0613182d0
commit
290f8e39f1
@ -27,7 +27,7 @@ extends Container
|
|||||||
|
|
||||||
|
|
||||||
var columns: int = 1 setget set_columns
|
var columns: int = 1 setget set_columns
|
||||||
|
var _min_x : int = 0
|
||||||
|
|
||||||
func _notification(p_what):
|
func _notification(p_what):
|
||||||
match p_what:
|
match p_what:
|
||||||
@ -41,6 +41,7 @@ func _notification(p_what):
|
|||||||
var vsep = get_constant("vseparation", "GridContainer")
|
var vsep = get_constant("vseparation", "GridContainer")
|
||||||
|
|
||||||
var min_columns = 1
|
var min_columns = 1
|
||||||
|
_min_x = 0
|
||||||
|
|
||||||
if get_child_count() > 0:
|
if get_child_count() > 0:
|
||||||
min_columns = int(floor(rect_size.x / (get_child(0).get_combined_minimum_size().x + hsep)))
|
min_columns = int(floor(rect_size.x / (get_child(0).get_combined_minimum_size().x + hsep)))
|
||||||
@ -62,6 +63,10 @@ func _notification(p_what):
|
|||||||
valid_controls_index += 1
|
valid_controls_index += 1
|
||||||
|
|
||||||
var ms: Vector2 = c.get_combined_minimum_size()
|
var ms: Vector2 = c.get_combined_minimum_size()
|
||||||
|
|
||||||
|
if _min_x < ms.x:
|
||||||
|
_min_x = ms.x
|
||||||
|
|
||||||
if col_minw.has(col):
|
if col_minw.has(col):
|
||||||
col_minw[col] = max(col_minw[col], ms.x)
|
col_minw[col] = max(col_minw[col], ms.x)
|
||||||
else:
|
else:
|
||||||
@ -187,6 +192,7 @@ func _get_minimum_size():
|
|||||||
max_row = max(row, max_row)
|
max_row = max(row, max_row)
|
||||||
|
|
||||||
var ms: Vector2
|
var ms: Vector2
|
||||||
|
ms.x = _min_x
|
||||||
|
|
||||||
for e in row_minh.keys():
|
for e in row_minh.keys():
|
||||||
ms.y += row_minh.get(e)
|
ms.y += row_minh.get(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user