From 5b71901912765377166812852f503ae7d2eee28a Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 7 Sep 2021 11:04:44 +0200 Subject: [PATCH] Flush pending underline when we are at the end of the line --- gpui/src/text_layout.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gpui/src/text_layout.rs b/gpui/src/text_layout.rs index a553b3b478..c74949b998 100644 --- a/gpui/src/text_layout.rs +++ b/gpui/src/text_layout.rs @@ -315,17 +315,17 @@ impl Line { color, }); } + } - if let Some(underline_start) = underline_start.take() { - let line_end = origin + baseline_offset + vec2f(self.layout.width, 0.); + if let Some(underline_start) = underline_start.take() { + let line_end = origin + baseline_offset + vec2f(self.layout.width, 0.); - cx.scene.push_underline(scene::Quad { - bounds: RectF::from_points(underline_start, line_end + vec2f(0., 1.)), - background: Some(color), - border: Default::default(), - corner_radius: 0., - }); - } + cx.scene.push_underline(scene::Quad { + bounds: RectF::from_points(underline_start, line_end + vec2f(0., 1.)), + background: Some(color), + border: Default::default(), + corner_radius: 0., + }); } }