Skip to content

Align center on Text elements does not always work correctly #1932

Open
@ohnoitsfraa

Description

@ohnoitsfraa

I'm building a product customization tool for my client and I'm using Konva heavily on this feature. One issue I'm having is that whenever I have a text element and I use the align() function, whenever I choose 'center' , it depends on the font if it shows correctly or not. For some fonts it's correctly centered, for other fonts it looks shifted to the left or right. Even changing it to uppercase or lowercase changes the visual horizontal alignment.

If I check the textWidth manually I see that it shows that correctly. I guess the centering of the text uses this textWidth property and the normal width property to function. Could there be something wrong with this? Or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions