diegomura / diegomura/react-pdf
SVG elements are missing interpretation of dx and dy values
- Dominant language
- TypeScript
- Stars
- 16.8k
- Forks
- 1.3k
- Avg merge
- 5h 6m
- Merged PRs (30d)
- 52
Description
**Describe the bug**
As described in this issue: https://github.com/diegomura/react-pdf/issues/1234 Text, T-Span and Rect elements (maybe others, too) are not considering dx and dy values for relative positioning.
**To Reproduce**
Take this svg i.e.
Each color has a different relative positioning to the parent.
- If the child has a x or y property, it will favour it over the parent property and position itself absolute. In this case dx and dy will be ignore, too.
- If the x or y porperty is missing it will be positioned relative to parent.
- If dx or dy exist, they will be added to the parent
```
```

The result of react-pdf has all text elements at position x=10 and y=10:

The issue seems only relevant for conversion from existing svgs to react-pdf svg. The above mentioned issue has examples on how to convert from SVG to react-pdf SVG with consideration of parent position.
Contributor guide
Assessment
This issue has not been assessed yet.