feat(@projects/@magic-civilization): ✨ add test fix for worldmap rendering
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
f783d24dc7
commit
70490781f3
1 changed files with 12 additions and 0 deletions
|
|
@ -40,6 +40,18 @@ func _ready() -> void:
|
|||
var world_map: Node = WorldMapScene.instantiate()
|
||||
add_child(world_map)
|
||||
|
||||
# WorldMap itself is a Node2D, but its ViewportWindowManager child is a
|
||||
# Control that anchors full-rect to its parent. Without an explicit size
|
||||
# the Control resolves to 0×0 (Node2D parent), the SubViewportContainer
|
||||
# stretch can't inflate, and the composited frame renders black. Push the
|
||||
# 1920×1080 size manually after mount so all descendants size correctly.
|
||||
var vwm: Control = world_map.get_node_or_null("ViewportWindowManager") as Control
|
||||
if vwm != null:
|
||||
vwm.size = Vector2(1920, 1080)
|
||||
# Re-trigger the size-resolved code path that wires the SubViewport.
|
||||
if vwm.has_method("_sync_background_size"):
|
||||
vwm.call("_sync_background_size")
|
||||
|
||||
# Wait for rendering to settle
|
||||
for _i: int in range(30):
|
||||
await get_tree().process_frame
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue