Skip to content

Commit

Permalink
update draw function
Browse files Browse the repository at this point in the history
  • Loading branch information
shivanshi0526 committed Jan 23, 2024
1 parent 7ef00d4 commit 46404c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dom-to-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
* @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
* */
function toPixelData(node, options) {
return draw(node, options || {})
return draw(node, options || {},loadfonts || true)
.then(function (canvas) {
return canvas.getContext('2d').getImageData(
0,
Expand Down Expand Up @@ -118,7 +118,7 @@
* */
function toJpeg(node, options) {
options = options || {};
return draw(node, options)
return draw(node, options,loadfonts || true)
.then(function (canvas) {
return canvas.toDataURL('image/jpeg', options.quality || 1.0);
});
Expand All @@ -130,7 +130,7 @@
* @return {Promise} - A promise that is fulfilled with a PNG image blob
* */
function toBlob(node, options) {
return draw(node, options || {})
return draw(node, options || {},loadfonts || true)
.then(util.canvasToBlob);
}

Expand Down

0 comments on commit 46404c6

Please sign in to comment.