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 TileSet editor workspace breaking #55059

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Nov 17, 2021

Fixes #52760

@@ -3336,7 +3336,7 @@ void TileSetEditor::update_workspace_minsize() {
}
}

workspace->set_custom_minimum_size(workspace_min_size + WORKSPACE_MARGIN * 2);
workspace->call_deferred("set_custom_minimum_size", workspace_min_size + WORKSPACE_MARGIN * 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you know why this fixes it, might be worth adding a comment to document it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented, although I don't exactly know why it works. The problem here was probably that workspace isn't inside any container, so it's very sensitive to size changes, and especially change order. But simply moving the line to the bottom didn't fix it, the call had to be deferred to work, which is weird. It's not the first time a random call_deferred() fixed a bug though 🙃

@KoBeWi KoBeWi force-pushed the call_deferred_to_the_rescue branch from 7917acc to f3d5ef6 Compare November 17, 2021 17:00
@akien-mga akien-mga merged commit d3659ee into godotengine:3.x Nov 17, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.4.1.

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.

2 participants