-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
text-decoration underline is misplaced #1364
Comments
Related: #1292 |
So I've looked at the values before rectangle / line is rendered and if I set baseline to 0, it renders correctly (or close enough). html2canvas/src/renderer/CanvasRenderer.js Line 253 in b7c7464
I am not certain about the details, but could the fix be |
I recently started using the last version of HTML2Canvas which should include the fix described above, however I kept getting a misplaced underline when I used text-decoration: underline just like it's mentioned at the beginning of this thread, I managed to fix the issue by modifying Math.round(text.bounds.top + text.bounds.height - baseline) to Math.round(text.bounds.top + text.bounds.height) in CanvasRenderer.js file, hope it helps anyone who's still having this issue. |
Bug reports:
http://jsfiddle.net/8rjbyqgj/
As you can see in jsfiddle, links that have a
text-decoration: underline
rule renders with a line above itSpecifications:
The text was updated successfully, but these errors were encountered: