Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ScriptEditor scrolling horizontally when reopening script #94439

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Jul 16, 2024

The script must have enough text to be able to scroll horizontally and the caret must not be saved on column 0.
The editor was scrolling horizontally to put the caret at the left edge of the screen when it doesn't need to.

There is another issue that causes it to scroll horizontally when the Editor opens, this only fixes it when a script is reopened.

adjust_viewport_to_caret was being called before the TextEdit is resized initially, so the visible_width was invalid.

Bugsquad Edit: Fixes #33865

@kitbdev kitbdev requested a review from a team as a code owner July 16, 2024 15:37
@AThousandShips AThousandShips added this to the 4.3 milestone Jul 16, 2024
@akien-mga akien-mga merged commit 05504eb into godotengine:master Jul 23, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@kitbdev kitbdev deleted the fix-reopen-hscroll branch July 24, 2024 02:21
@kitbdev
Copy link
Contributor Author

kitbdev commented Jul 24, 2024

This doesn't fix #33865 in all situations, such as when the editor is opened. It may depend on resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Previously opened script's horizontal scrollbars are shifted after application restart
4 participants