Skip to content

Bounds not correctly computed for texts and groups #1144

Open
@Moggel12

Description

@Moggel12

Both text elements with multiple child tspan elements, and group elements, incorrectly compute the bounding box. Have not tested other elements.

Example: creating a text element with three tspans internally (using the dy property to simulate newlines) and calling .Bounds will return a box that does not fit the entire text nor is positioned correctly. Putting the text element inside a group will act likewise. Atleast this is the case when trying to render the box via a rect element in an SVG file.
In my case font-size is set to 15 with Sans-Serif font family. Using text-anchor or dominant-baseline does not seem to help either.

Using SVG v3.4.6 and .NET 7.

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