mirror of https://github.com/godotengine/godot
Fix ScriptEditor scrolling horizontally on reopen
This commit is contained in:
parent
97b8ad1af0
commit
f8df6b1c70
|
|
@ -5913,6 +5913,11 @@ void TextEdit::adjust_viewport_to_caret(int p_caret) {
|
||||||
}
|
}
|
||||||
visible_width -= 20; // Give it a little more space.
|
visible_width -= 20; // Give it a little more space.
|
||||||
|
|
||||||
|
if (visible_width <= 0) {
|
||||||
|
// Not resized yet.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Vector2i caret_pos;
|
Vector2i caret_pos;
|
||||||
|
|
||||||
// Get position of the start of caret.
|
// Get position of the start of caret.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue