From d71f671476e4c389e01d075938692a51921613ca Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 8 Nov 2023 17:32:21 +0100 Subject: [PATCH] Fix clipping in `Line::draw` Co-Authored-By: Nathan Co-Authored-By: Marshall --- crates/gpui2/src/text_system/line.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/gpui2/src/text_system/line.rs b/crates/gpui2/src/text_system/line.rs index ad70a79bb1e411fdaa4b0fddc0de39bdbf96e7af..707274ad33f26ce2212512c97df5527bd420ead7 100644 --- a/crates/gpui2/src/text_system/line.rs +++ b/crates/gpui2/src/text_system/line.rs @@ -74,7 +74,6 @@ impl Line { glyph_origin.y += line_height; } prev_glyph_position = glyph.position; - let glyph_origin = glyph_origin + baseline_offset; let mut finished_underline: Option<(Point, UnderlineStyle)> = None; if glyph.index >= run_end { @@ -125,14 +124,14 @@ impl Line { if max_glyph_bounds.intersects(&content_mask.bounds) { if glyph.is_emoji { cx.paint_emoji( - glyph_origin, + glyph_origin + baseline_offset, run.font_id, glyph.id, self.layout.layout.font_size, )?; } else { cx.paint_glyph( - glyph_origin, + glyph_origin + baseline_offset, run.font_id, glyph.id, self.layout.layout.font_size,