Skip to content

Commit

Permalink
Merge pull request #94439 from kitbdev/fix-reopen-hscroll
Browse files Browse the repository at this point in the history
Fix ScriptEditor scrolling horizontally when reopening script
  • Loading branch information
akien-mga committed Jul 23, 2024
2 parents f6c7b00 + f8df6b1 commit 05504eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scene/gui/text_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 05504eb

Please sign in to comment.