From 2efc90adc6bccf30d147b095dc940883891145f6 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 31 Mar 2021 14:51:51 -0700 Subject: [PATCH] Ensure that path windings are rendered to the right atlas texture Fixes #5 --- gpui/src/platform/mac/renderer.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gpui/src/platform/mac/renderer.rs b/gpui/src/platform/mac/renderer.rs index 56259cc9b5..4b17907953 100644 --- a/gpui/src/platform/mac/renderer.rs +++ b/gpui/src/platform/mac/renderer.rs @@ -164,14 +164,16 @@ impl Renderer { }, }); - if current_atlas_id.map_or(false, |current_atlas_id| atlas_id != current_atlas_id) { - self.render_path_stencils_for_atlas( - offset, - &vertices, - atlas_id, - command_buffer, - ); - vertices.clear(); + if let Some(current_atlas_id) = current_atlas_id { + if atlas_id != current_atlas_id { + self.render_path_stencils_for_atlas( + offset, + &vertices, + current_atlas_id, + command_buffer, + ); + vertices.clear(); + } } current_atlas_id = Some(atlas_id);