From 04903830043f8b2e0edcefddf728d4913df544e0 Mon Sep 17 00:00:00 2001 From: Ijtihed Date: Fri, 29 May 2026 16:37:08 +0300 Subject: [PATCH] Fix Polygon2D culling against a stale AABB on the draw fast path The #117334 fast path updates vertices in place without refreshing the mesh AABB soo the node is culled against its previous bounds. Fixes #119843 --- scene/2d/polygon_2d.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 279f554df8..aabe571265 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -415,12 +415,14 @@ void Polygon2D::_notification(int p_what) { if (needs_clear) { RS::get_singleton()->mesh_add_surface(mesh, sd); + RS::get_singleton()->mesh_set_custom_aabb(mesh, AABB()); } else { RS::get_singleton()->mesh_surface_update_vertex_region(mesh, 0, 0, sd.vertex_data); if (has_uv || has_color) { RS::get_singleton()->mesh_surface_update_attribute_region(mesh, 0, 0, sd.attribute_data); } RS::get_singleton()->mesh_surface_update_index_region(mesh, 0, 0, sd.index_data); + RS::get_singleton()->mesh_set_custom_aabb(mesh, sd.aabb); } }