input: Fix selection rendering for empty lines. (#868)

<img width="491" alt="image"
src="https://github.com/user-attachments/assets/b24e4fbc-40e8-4570-b254-2974aa7735a7"
/>
This commit is contained in:
Jason Lee 2025-05-19 20:32:46 +08:00 committed by GitHub
parent b97abd6394
commit 67dd658635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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),