From 5bedaf77f71a38bc8c066931526775c52bd2e823 Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:49:32 +0200 Subject: [PATCH] Fix 2D debug navigation flickering with tile maps Both the tile map layers and the debug navigation canvas items did fight for the same z order causing a lot of flickering in certain situations. --- scene/2d/navigation_region_2d.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index 9b3c7bb9ea82..f65a3c0eccab 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -452,6 +452,7 @@ void NavigationRegion2D::_update_debug_mesh() { const Transform2D region_gt = get_global_transform(); rs->canvas_item_set_parent(debug_instance_rid, get_world_2d()->get_canvas()); + rs->canvas_item_set_z_index(debug_instance_rid, RS::CANVAS_ITEM_Z_MAX - 2); rs->canvas_item_set_transform(debug_instance_rid, region_gt); if (!debug_mesh_dirty) {