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

"Attach Node Script" dialog box spawns slightly off-center #14659

Closed
ghost opened this issue Dec 14, 2017 · 5 comments
Closed

"Attach Node Script" dialog box spawns slightly off-center #14659

ghost opened this issue Dec 14, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 14, 2017

Operating system or device, Godot version
Linux Mint 18.3 Sylvia x64, Godot 3.0 f3ad142

Issue description:
The dialog box always seems to appear too far down and to the right:
image

@vnen
Copy link
Member

vnen commented Dec 14, 2017

This happens for me only the first time the dialog is open. The next time I open the dialog is in the center.

@ghost
Copy link
Author

ghost commented Dec 14, 2017

@vnen Good observation.

@kidrigger
Copy link
Contributor

I called popup_centered() twice in a row instead of just once and it started to align to center. I'm trying to trace the reason why the second call centers the dialog.

@akien-mga
Copy link
Member

See #16069, which is a later duplicate but has some more debugging details, so closing this one in favour of #16069.

@akien-mga akien-mga added this to the 3.1 milestone Feb 16, 2018
@ghost
Copy link
Author

ghost commented May 1, 2019

This behaviour still occurs as of dd2cd06.

image

However, it only happens when adding a script from the Scene dock; creating a script from within the Script editor (File > New Script...) has the dialog centered correctly the first time. I narrowed it down to this line:

script_create_dialog->popup_centered(Size2(300, 300) * EDSCALE);

The Scene dock's dialog is popped up without any size information:

script_create_dialog->popup_centered();

Adding it fixes the problem. I have no idea why, though. Is it worth making a PR for this, or is a proper fix desired?

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

Successfully merging a pull request may close this issue.

3 participants