Skip to content

Misaligned text decorations #166

Description

@Lemonymous

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupIssues and pull requests related to improving the codebase without direct functional changes

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions