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 button placement in minimized in-game windows #1614

Merged

Conversation

falbrechtskirchinger
Copy link
Contributor

As mentioned, I've discovered a bug introduced in 938f355 #1609. This is a very quick fix. Let me know if you'd prefer to store the full size in IngameWindow and add a GetFullSize() member function, or maybe a different solution entirely.

inventory_buttons

Commit message follows:


Some windows position their buttons based on GetSize().y, which results in incorrect placement if the window is persisted and minimized. Replace uses of GetSize().y with the full window height.

Affected windows:

  • iwBuildings
  • iwDistribution
  • iwWares

@Flamefire
Copy link
Member

Flamefire commented Jul 26, 2023

Let me know if you'd prefer to store the full size in IngameWindow and add a GetFullSize() member function, or maybe a different solution entirely.

Sounds more reasonable to me as it has less constants floating around. That member function looks easy to implement too: combine iwHeight and contentOffset + contentOffsetEnd similar to what is done (in reverse) in https://github.com/Return-To-The-Roots/s25client/blob/master/libs/s25main/ingameWindows/IngameWindow.cpp#L89C20-L89C29

Returns the full size of the window, even when minimized.
Some windows position their buttons based on GetSize().y, which results
in incorrect placement if the window is persisted and minimized.
Replace uses of GetSize() with GetFullSize().

Affected windows:
* iwBuildings
* iwDistribution
* iwWares
@Flamefire Flamefire enabled auto-merge July 26, 2023 12:28
@Flamefire Flamefire merged commit ad0749b into Return-To-The-Roots:master Jul 26, 2023
10 checks passed
@falbrechtskirchinger falbrechtskirchinger deleted the fix-buttons branch July 26, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants