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 spacing for 100M+ XP #7688

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vlolteanu
Copy link
Contributor

Depending on how "fat" the digits happen to be, regular spacing in the char panel might be too wide at 100M XP. Notice how the "1" is really awkwardly placed. Something similar happens at 1B.

Before:
image

After:
image

@kphoenix137
Copy link
Collaborator

kphoenix137 commented Feb 1, 2025

How do we determine spacing in the Info Panel? Maybe it would be more maintainable to use the same method. I mean this for all of the Character panel values as well. The current method feels quite "hardcodey".

@vlolteanu
Copy link
Contributor Author

How do we determine spacing in the Info Panel? Maybe it would be more maintainable to use the same method. I mean this for all of the Character panel values as well. The current method feels quite "hardcodey".

I guess we could render the text to some internal buffer using smaller and smaller spacing until it fits.

The alternative is to stress-test stuff by hand using zeroes and see what the breakpoints are.It's just XP and DMG in the char panel; the others fit just fine.

@StephenCWills
Copy link
Member

How do we determine spacing in the Info Panel?

We just pass UiFlags::KerningFitSpacing into DrawString(). The rendering function figures out what the spacing should be by computing the width of the string before rendering and comparing it to the size of the bounding box for the text.

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.

3 participants