bubkoo / html-to-image

✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
MIT License
5.4k stars 505 forks source link

fix: workaround for respecting scrollbar positions #408

Open 2knu opened 1 year ago

2knu commented 1 year ago

Description

Workaround for respecting scrollbar positions

Motivation and Context

Fix #345 and #81. Just setting scrollLeft and scrollTop is not working, therefore this change simulate it by translate all children to the correct position and hide the scrollbars.

Types of changes

Self Check before Merge

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 94.44% and no project coverage change.

Comparison is base (b751cbf) 62.93% compared to head (a6e1355) 62.93%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #408 +/- ## ======================================= Coverage 62.93% 62.93% ======================================= Files 10 10 Lines 580 580 Branches 143 143 ======================================= Hits 365 365 Misses 151 151 Partials 64 64 ``` | [Impacted Files](https://app.codecov.io/gh/bubkoo/html-to-image/pull/408?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96) | Coverage Δ | | |---|---|---| | [src/clone-node.ts](https://app.codecov.io/gh/bubkoo/html-to-image/pull/408?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2Nsb25lLW5vZGUudHM=) | `71.42% <94.44%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.