Skip to content

Fix LabelComponent center alignment #350

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

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

Conversation

ZENEGIX
Copy link

@ZENEGIX ZENEGIX commented Feb 5, 2025

Bug description:
When trying to center a LabelComponent, the text is centered incorrectly

XML reproducer:

<owo-ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <components>
        <flow-layout direction="vertical" id="body">
            <children>
                <label>
                    <text>Groups</text>
                    <vertical-text-alignment>center</vertical-text-alignment>
                    <horizontal-text-alignment>center</horizontal-text-alignment>

                    <sizing>
                        <horizontal method="fill">20</horizontal>
                        <vertical method="fill">20</vertical>
                    </sizing>
                </label>
            </children>

            <surface>
                <flat>#C0101010</flat>
            </surface>
        </flow-layout>
    </components>
</owo-ui>

Actual behavior:
image

Expected behavior:
image

Fix note:
Double inflate fix this behaviour like in TextAreaComponent. Maybe its not optimal way to fix

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.

1 participant