Skip to content

Commit 46404c6

Browse files
committed
update draw function
1 parent 7ef00d4 commit 46404c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dom-to-image.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
* @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
8989
* */
9090
function toPixelData(node, options) {
91-
return draw(node, options || {})
91+
return draw(node, options || {},loadfonts || true)
9292
.then(function (canvas) {
9393
return canvas.getContext('2d').getImageData(
9494
0,
@@ -118,7 +118,7 @@
118118
* */
119119
function toJpeg(node, options) {
120120
options = options || {};
121-
return draw(node, options)
121+
return draw(node, options,loadfonts || true)
122122
.then(function (canvas) {
123123
return canvas.toDataURL('image/jpeg', options.quality || 1.0);
124124
});
@@ -130,7 +130,7 @@
130130
* @return {Promise} - A promise that is fulfilled with a PNG image blob
131131
* */
132132
function toBlob(node, options) {
133-
return draw(node, options || {})
133+
return draw(node, options || {},loadfonts || true)
134134
.then(util.canvasToBlob);
135135
}
136136

0 commit comments

Comments
 (0)