png transparent
This commit is contained in:
parent
38d2e779b6
commit
a6d5239855
|
@ -44,8 +44,8 @@ export function saveImg(value, content, width, height, type) {
|
||||||
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
ctx.fillStyle = 'white'
|
ctx.fillStyle = 'white';
|
||||||
ctx.fillRect(0, 0, width, height)
|
if (type === 'jpg') ctx.fillRect(0, 0, width, height);
|
||||||
ctx.drawImage(img, 0, 0, width, height);
|
ctx.drawImage(img, 0, 0, width, height);
|
||||||
// `download` attr is not well supported
|
// `download` attr is not well supported
|
||||||
// Will result in a download popup for chrome and the
|
// Will result in a download popup for chrome and the
|
||||||
|
|
Loading…
Reference in New Issue