-
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
offset in rendered img #1298
Comments
the problem occurs because foreignObject is rendered as xhtml strict and do not use doctypes. if the original document's doctype is different (ex: html4 transitional) the images will be spaced differently. here is another testcase demonstrating the issue: this commit fixes this bug : 5c6c17d unfortunately I pushed it on top of 4fdf69d which has been submited as a pull request here : #1268 . now the new commit is referenced in the pull request and I'm not sure of the recommended way to handle this. |
the issue has two causes :
commit 5c6c17d solves the issue for both renderers, but only for images. I'm not aware of any other issue related to doctype-dependent rendering but they may exist |
Foreign object rendering has a number of issues, so will not be fixing this for it for now. |
When capturing an image below another one, the rendered image has an offset. the upper part is blank and the lower part is truncated.
this occurs wether foreignObjectRendering is used or not.
in this exemple, the canvas rendered by html2canvas from the second image has a red border to make the bug more obvious:
test case (would not work in jsfiddle due to cross origin issues):
testcase.zip
The text was updated successfully, but these errors were encountered: