Skip to content

Commit 2c0edaa

Browse files
author
bjningbo
committed
区分绘制图片是否为base64
1 parent dbe5769 commit 2c0edaa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/create-picture.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
/* 说明 V 0.3.0
1+
/* 说明 V 0.3.1
22
* 该组件提供了 canvas 的图片绘制与文本绘制功能,使用同步的语法完成异步绘制,简化原生 canvas 绘制语法。
33
* API:https://github.com/NalvyBoo/create-picture
44
* npm:https://www.npmjs.com/package/create-picture
55
* */
66

77
let saidHello = false;
8-
const VERSION = '0.3.0';
8+
const VERSION = '0.3.1';
99
const defaultProp = {
1010
width: 750,
1111
height: 1448,
@@ -123,7 +123,7 @@ export default class CreatePicture{
123123
resolve(imageArr)
124124
};
125125
image.crossOrigin = 'anonymous';
126-
image.src = assetsArr[index]+'?corp';
126+
image.src = assetsArr[index].indexOf('data:')>-1? assetsArr[index] : assetsArr[index]+'?corp';
127127
}
128128
}));
129129
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-picture",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "该组件提供了 Canvas 的图片绘制与文本绘制功能,使用同步的语法完成异步绘制,简化原生 canvas 绘制语法。",
55
"main": "lib/create-picture.js",
66
"scripts": {

0 commit comments

Comments
 (0)