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

Update ImGui window positions on every resize #72353

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

ZeroInternalReflection
Copy link
Contributor

Summary

None

Purpose of change

When the Cataclysm window is resized, the position of any ImGui windows is not correctly updated, so windows that are supposed to be centered end up misaligned
Fixes #72058

Describe the solution

Set cataimgui::window to update the position each time it's resized. The previous setting "ImGuiCond_Appearing", apparently only actually moves the window when it's first created/unhidden.

Describe alternatives you've considered

Testing

Existing UI behaviour:

Old_UI_Behaviour.mp4

Current ImGui behaviour:

Current_ImGui_Behaviour.mp4

After this change:

ImGui_Correct_Repositioning.mp4

Additional context

@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Mar 13, 2024
@mqrause
Copy link
Contributor

mqrause commented Mar 13, 2024

That seems to only be an issue if you use -1 for x and y in get_bounds? At least it properly repositions in #55503.

Edit: I should read the actual code first. Yeah, this is explicitly for the -1 case because that tries to center the window.

@dseguin dseguin merged commit 16e2dce into CleverRaven:master Mar 14, 2024
22 of 28 checks passed
SurFlurer added a commit to SurFlurer/Cataclysm-DDA that referenced this pull request Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Imgui When I resize window, the keybinding menu doesn't resize (doesn't move to center)
3 participants