input: Fix Input cursor x position when scrolled. (#966)

https://github.com/user-attachments/assets/db76d3a3-ecd6-45c6-8377-0afa4746f2db
This commit is contained in:
Jason Lee 2025-06-17 14:14:23 +08:00 committed by GitHub
parent de491a790c
commit 869d48b446
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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