diegomura / react-pdf

📄 Create PDF files using React
https://react-pdf.org
MIT License
15.02k stars 1.19k forks source link

fix: calculate x position of tspan elements without explicit x prop #2961

Open klingebiel-sii opened 1 week ago

klingebiel-sii commented 1 week ago

Fixes https://github.com/diegomura/react-pdf/issues/2931

If the x attribute of a <tspan> has not been defined explicitly, the current behavior causes the each <tspan> to inherit the x value of it's parent <text> element.

<Svg>
    <Text x="10" y="30">
        <Tspan>One</Tspan>
        <Tspan>Two</Tspan>
        <Tspan>Three</Tspan>
    </Text>
</Svg>

Is: image

Should: image

This PR fixes this issue by...

changeset-bot[bot] commented 1 week ago

⚠️ No Changeset found

Latest commit: a6cf9f9cda0e9f8c46e9041737a17d73b1e507c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR