From 869d48b446ef0e1e6913a04ffbf15c3c49b98dc2 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 17 Jun 2025 14:14:23 +0800 Subject: [PATCH] input: Fix Input cursor x position when scrolled. (#966) https://github.com/user-attachments/assets/db76d3a3-ecd6-45c6-8377-0afa4746f2db --- crates/ui/src/input/element.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui/src/input/element.rs b/crates/ui/src/input/element.rs index e6bdc8f4..38a38f9f 100644 --- a/crates/ui/src/input/element.rs +++ b/crates/ui/src/input/element.rs @@ -178,7 +178,7 @@ impl TextElement { let cursor_height = line_height; cursor_bounds = Some(Bounds::new( point( - bounds.left() + cursor_pos.x + line_number_width, + bounds.left() + cursor_pos.x + line_number_width + scroll_offset.x, bounds.top() + cursor_pos.y + ((line_height - cursor_height) / 2.), ), size(CURSOR_WIDTH, cursor_height),