Godot 4 VBoxContainer Control nodes overlapping

'''
extends Node

var popup_window: Panel

func _ready():
    popup_window = Panel.new()
    add_child(popup_window)
    popup_window.visible = false
    popup_window.z_index = 10  # Ensure it's on top

    # Create a stylebox for the panel's background
    var stylebox = StyleBoxFlat.new()
    stylebox.bg_color = Color(0.1, 0.1, 0.1, 0.5)  # Set background color (e.g., dark gray with some transparency)
    popup_window.add_theme_stylebox_override("panel", stylebox)
    
    # Add the vertical container for the Area2D nodes
    var vbox = VBoxContainer.new()
    popup_window.add_child(vbox)
    
    var rawComponents: Array[CollisionPolygon2D] = []
    var folder_path = "res://objects/"
    var dir = DirAccess.open(folder_path)
    if dir != null:
        dir.list_dir_begin()
        var file_name = dir.get_next()
        
        while file_name != "":
            if !dir.current_is_dir() and (file_name.ends_with(".tscn") or file_name.ends_with(".res")):
                var file_path = folder_path + file_name
                var resource = load(file_path)
                if resource:
                    var collision_polygon
                    if resource is PackedScene:
                        collision_polygon = resource.instantiate()
                    else:
                        collision_polygon = resource

                    if collision_polygon is CollisionPolygon2D:
                        rawComponents.append(collision_polygon)
                        print("Added CollisionPolygon2D from: ", file_path)
                    else:
                        print("Not a CollisionPolygon2D: ", file_path)
                else:
                    print("Failed to load: ", file_path)
            
            file_name = dir.get_next()
        dir.list_dir_end()
    
    print("Number of elements in rawComponents: ", len(rawComponents))
    
    for component in rawComponents:
        var area = Area2D.new()
        area.add_child(component)
        area.scale *= 0.25
        area.rotation_degrees += 90
        
        # Create a Control node to wrap the Area2D
        var container = Control.new()

        # Set a minimum size for the Control container
        var polygon_size = calculate_polygon_size(component)
        container.custom_minimum_size = polygon_size
        print("container size =", container.custom_minimum_size)

        # Add the Area2D to the Control container
        container.add_child(area)
        
        # Add the Control container to the VBoxContainer
        vbox.add_child(container)
    
    # Force update the VBoxContainer's layout
    vbox.queue_sort()

    # Set the size of the popup window to match the VBoxContainer
    popup_window.custom_minimum_size = vbox.get_combined_minimum_size()

    
func calculate_polygon_size(polygon: CollisionPolygon2D) -> Vector2:
    if polygon.polygon.size() == 0:
        return Vector2.ZERO
    
    var min_x = polygon.polygon[0].x
    var max_x = polygon.polygon[0].x
    var min_y = polygon.polygon[0].y
    var max_y = polygon.polygon[0].y
    
    for point in polygon.polygon:
        min_x = min(min_x, point.x)
        max_x = max(max_x, point.x)
        min_y = min(min_y, point.y)
        max_y = max(max_y, point.y)
    
    return Vector2(max_y - min_y, max_x - min_x) / 4

func show_popup(target_position: Vector2):
    if popup_window == null:
        print("Error: popup_window is not initialized")
        return
    
    var window_size = popup_window.custom_minimum_size
    var popup_position = target_position - Vector2(0, window_size.y / 2)
    popup_window.position = popup_position
    popup_window.visible = true

func hide_popup():
    if popup_window != null:
        popup_window.visible = false

func _on_area_mouse_entered(area):
    print("Mouse entered: ", area)
    show_popup(area.global_position)

func _on_area_mouse_exited(area):
    print("Mouse exited: ", area)
    hide_popup()
'''

My understanding is that Control nodes as children of VBoxContainers should automatically space vertically. This is not happening. The “containers” are overlapping. I’m trying to create a visual list of collisionPolygon2d’s that will eventually be selectable from a window that pops up when I roll over a “hard point” which is an Area2D with a collision shape/sprite/script. Any help or criticism would be appreciated.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật