Merge pull request #86732 from TheSofox/line-edit-delete-fix
Make `LineEdit` scrolling show as much text as possible
This commit is contained in:
commit
50a073cb0e
1 changed files with 6 additions and 0 deletions
|
@ -1718,6 +1718,12 @@ void LineEdit::set_caret_column(int p_column) {
|
||||||
} else if (MAX(primary_caret_offset.x, primary_caret_offset.y) >= ofs_max) {
|
} else if (MAX(primary_caret_offset.x, primary_caret_offset.y) >= ofs_max) {
|
||||||
scroll_offset += ofs_max - MAX(primary_caret_offset.x, primary_caret_offset.y);
|
scroll_offset += ofs_max - MAX(primary_caret_offset.x, primary_caret_offset.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Scroll to show as much text as possible
|
||||||
|
if (text_width + scroll_offset + x_ofs < ofs_max) {
|
||||||
|
scroll_offset = ofs_max - x_ofs - text_width;
|
||||||
|
}
|
||||||
|
|
||||||
scroll_offset = MIN(0, scroll_offset);
|
scroll_offset = MIN(0, scroll_offset);
|
||||||
|
|
||||||
queue_redraw();
|
queue_redraw();
|
||||||
|
|
Loading…
Reference in a new issue