From c3f2e39ba59da085525e8ca599e8e738367c2af2 Mon Sep 17 00:00:00 2001 From: umajho Date: Sat, 11 Apr 2026 19:53:13 +0800 Subject: [PATCH] Fix(egui): underlines are always drawn below the first line of text --- crates/egui/src/text_selection/visuals.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/text_selection/visuals.rs b/crates/egui/src/text_selection/visuals.rs index 95323202d..d3c0f7764 100644 --- a/crates/egui/src/text_selection/visuals.rs +++ b/crates/egui/src/text_selection/visuals.rs @@ -244,8 +244,10 @@ fn paint_underlines( row.size.x }; + let offset_y = placed_row.pos.y + row.size.y; + painter.line_segment( - [pos + vec2(left, row.size.y), pos + vec2(right, row.size.y)], + [pos + vec2(left, offset_y), pos + vec2(right, offset_y)], stroke, ); }