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: Bug that changes content size when width and height are set to 'style' tag in canvas #409

Open userJu opened 1 year ago

userJu commented 1 year ago

Description

Width and height properties were set using the setAttribute method on canvas.

Motivation and Context

Types of changes

Self Check before Merge

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #409 +/- ## ======================================= 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/409?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96) | Coverage Δ | | |---|---|---| | [src/index.ts](https://app.codecov.io/gh/bubkoo/html-to-image/pull/409?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2luZGV4LnRz) | `89.47% <100.00%> (ø)` | |

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