mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-25 21:27:30 +01:00
Fix cursor after last character in line counting as a character outside of the viewing area
The cursor column can be after the last_visible_char index and still be visible.
This commit is contained in:
parent
43ba59106a
commit
519d0647fd
@ -4838,7 +4838,7 @@ Rect2 TextEdit::get_rect_at_line_column(int p_line, int p_column) const {
|
||||
|
||||
int first_visible_char = cache_entry.first_visible_char[wrap_index];
|
||||
int last_visible_char = cache_entry.last_visible_char[wrap_index];
|
||||
if (p_column < first_visible_char || p_column > last_visible_char) {
|
||||
if (p_column < first_visible_char || p_column > (last_visible_char + 1)) {
|
||||
// Character is outside of the viewing area, no point calculating its position.
|
||||
return Rect2i(-1, -1, 0, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user