You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I guess this would not cover every/other use cases.
Specifications:
html2canvas version tested with: 1.1.4
Browser & version: Chrome 92
The text was updated successfully, but these errors were encountered:
jebibot
changed the title
Images with pixel density srcset are clipped on devicePixelRatio > 1
Images with pixel density srcset are clipped on devicePixelRatio > 1Jul 27, 2021
Bug reports:
Images with multiple
srcset
specified by pixel density descriptors, for example:get clipped if
html2canvas
is run on devices wherewindow.devicePixelRatio > 1
.Reproduction:
How to reproduce:
Responsive
or a device with higher device pixel ratioPossible cause and workaround
This issue seems to be caused by
naturalWidth
andnaturalHeight
of an image being different from actual image sizes on higher device pixel ratio.This can be worked around by removing sub-rectangle parameters from
drawImage()
inrenderReplacedElement()
(https://github.com/jebibot/html2canvas/commit/d5f2bb3e19e4c4ffa662ceb0cddd04c1f2f3867b, see patched above):html2canvas/src/render/canvas/canvas-renderer.ts
Lines 281 to 284 in 5dea36b
However, I guess this would not cover every/other use cases.
Specifications:
The text was updated successfully, but these errors were encountered: