From 67dd6586350a96166003420936debeb2004ed3f4 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 19 May 2025 20:32:46 +0800 Subject: [PATCH] input: Fix selection rendering for empty lines. (#868) image --- crates/ui/src/input/element.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui/src/input/element.rs b/crates/ui/src/input/element.rs index 70a5a516..45de14dd 100644 --- a/crates/ui/src/input/element.rs +++ b/crates/ui/src/input/element.rs @@ -226,6 +226,9 @@ impl TextElement { end_x = line_wrap_width; } + // Ensure at least 6px width for the selection for empty lines. + end_x = end_x.max(start.x + px(6.)); + line_corners.push(Corners { top_left: line_origin + point(start.x, start.y), top_right: line_origin + point(end_x, start.y),