Merge pull request #94439 from kitbdev/fix-reopen-hscroll

Fix ScriptEditor scrolling horizontally when reopening script
This commit is contained in:
Rémi Verschelde 2024-07-23 15:55:32 +02:00
commit 05504ebf27
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 5 additions and 0 deletions

View File

@ -5913,6 +5913,11 @@ void TextEdit::adjust_viewport_to_caret(int p_caret) {
}
visible_width -= 20; // Give it a little more space.
if (visible_width <= 0) {
// Not resized yet.
return;
}
Vector2i caret_pos;
// Get position of the start of caret.