Skip to content
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

<use> does not clip text tags correctly #174

Open
Qendolin opened this issue Apr 14, 2021 · 1 comment
Open

<use> does not clip text tags correctly #174

Qendolin opened this issue Apr 14, 2021 · 1 comment
Labels
bug difficulty:medium Hacktoberfest help wanted Help with creating a proper test-case, looking up the spec, or creating a pull request.

Comments

@Qendolin
Copy link

Describe the bug
<text> tags referenced by <use> aren't clipped correctly.
The text exists in the pdf (can be selected) but is partially or completely invisible.

Versions:
jsPDF: 2.3.1
svg2pdf.js: 2.1.0

To Reproduce
Reference a <text> tag in a <use> tag.

See playground

Expected behavior
The complete text referenced by the <use> tags should be visible in the pdf.

Screenshots
SVG and PDF

Desktop

  • OS: Windows
  • Browser Chrome 89
  • Version 10
@HackbrettXXX
Copy link
Member

Thanks for reporting this bug. Seems like the bounding boxes aren't correct for text elements. This looks very suspicious ;):

protected getBoundingBoxCore(context: Context): Rect {
return defaultBoundingBox(this.element, context)
}

@HackbrettXXX HackbrettXXX added bug difficulty:medium help wanted Help with creating a proper test-case, looking up the spec, or creating a pull request. labels Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug difficulty:medium Hacktoberfest help wanted Help with creating a proper test-case, looking up the spec, or creating a pull request.
Projects
None yet
Development

No branches or pull requests

2 participants