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

Misaligned text decorations #166

Open
Lemonymous opened this issue Sep 20, 2022 · 0 comments
Open

Misaligned text decorations #166

Lemonymous opened this issue Sep 20, 2022 · 0 comments
Labels
cleanup Issues and pull requests related to improving the codebase without direct functional changes

Comments

@Lemonymous
Copy link
Contributor

Issue:

When using DecoAlignedText or DecoCAlignedText, text will not be correctly aligned due to the usage of sdlext.totalWidth within them. If the call to sdlext.totalWidth(surface) is changed to surface:w(), the text becomes perfectly aligned. This causes a lot of trial and error when creating new ui, nudging texts slightly to make them line up correctly.

Why sdlext.totalWidth was introduced to the best of my knowledge:

When the mod loader was created all text surfaces had slight padding to the left and right of the text. This padding was removed in itb-community/DLL-Extensions#8

sdlext.totalWidth was then created likely in order to make all the current UI in the mod loader identical to before.

Proposed Change:

Removing the usage of sdlext.totalWidth would require going over all of the existing ui, and make updates to make sure everything is still aligned, since many of the current texts are slightly nudged to account for the misalignment.

@KnightMiner KnightMiner added the cleanup Issues and pull requests related to improving the codebase without direct functional changes label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Issues and pull requests related to improving the codebase without direct functional changes
Projects
None yet
Development

No branches or pull requests

2 participants