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

"popup_centered_minsize" doesn't center the popup #16069

Closed
YeldhamDev opened this issue Jan 25, 2018 · 6 comments · Fixed by #19334
Closed

"popup_centered_minsize" doesn't center the popup #16069

YeldhamDev opened this issue Jan 25, 2018 · 6 comments · Fixed by #19334

Comments

@YeldhamDev
Copy link
Member

Godot version:
0181681

Issue description:
When showing a popup using the popup_centered_minsize method, the popup will not be correctly centered. Here is a image with a centered button used to trigger it:
screenshot1

@akien-mga akien-mga added this to the 3.1 milestone Jan 25, 2018
@akien-mga
Copy link
Member

I've seen that too (it's pretty visible with the warning dialog I added to the Mono build, which doesn't start properly centered). I read about this issue a week ago on the issue tracker too, but couldn't find the duplicate again, it might have just been in a comment of an unrelated issue.

@vnen
Copy link
Member

vnen commented Jan 26, 2018

I have a hunch that this happens because the minimum size is 0,0 by default, and the engine is using that value to centralize, instead of the actual size.

@YeldhamDev
Copy link
Member Author

@vnen Your hunch appears to be correct, did it again, but passed the popup's size to the method, and it centralizes it properly. I always thought that the default values being 0 was for it automatically using the popup's minsize, because otherwise there is no sense for these defaults at all.

Also, I think I found another bug. While it the method squishes the popup horizontally, it doesn't affect anything vertically:
screenshot1

@leopoldek
Copy link
Contributor

I think it might be that the window title size is not being taken into account when calculating the size.
Correct:
popup_correct
Wrong:
popup_wrong

@kidrigger
Copy link
Contributor

@Mr-Slurpy Are you working on this? Or can I?

@leopoldek
Copy link
Contributor

@kidrigger You can work on it.

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