From 656fcb2ce7efcf558d48fbeb694d781e9a1c531a Mon Sep 17 00:00:00 2001 From: ira Date: Sat, 15 Jul 2023 23:18:13 +0200 Subject: [PATCH] Fix gizmo draw order in 2D (#9129) # Objective Gizmos are intended to draw over everything but for some reason I set the sort key to `0` during #8427 :v I didn't catch this mistake because it still draws over sprites with a Z translation of `0`. ## Solution Set the sort key to `f32::INFINITY`. --- crates/bevy_gizmos/src/pipeline_2d.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_gizmos/src/pipeline_2d.rs b/crates/bevy_gizmos/src/pipeline_2d.rs index be983becec..06f21138d8 100644 --- a/crates/bevy_gizmos/src/pipeline_2d.rs +++ b/crates/bevy_gizmos/src/pipeline_2d.rs @@ -166,7 +166,7 @@ fn queue_line_gizmos_2d( entity, draw_function, pipeline, - sort_key: FloatOrd(0.), + sort_key: FloatOrd(f32::INFINITY), batch_range: None, }); }