kfb-view 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/workspace.xml +16 -12
- package/lib/kfb-view.js +1 -1
- package/package.json +1 -1
- package/src/components/tailoring/index.js +13 -2
package/package.json
CHANGED
|
@@ -29,11 +29,22 @@ export class Tailoring extends ViewerCommon {
|
|
|
29
29
|
this.movePointIndex = -1;
|
|
30
30
|
this.color = '#FFF';
|
|
31
31
|
this.contents = [];
|
|
32
|
+
this.imageType = 'jpeg';
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
init({
|
|
35
|
+
init({
|
|
36
|
+
width,
|
|
37
|
+
height,
|
|
38
|
+
left,
|
|
39
|
+
top,
|
|
40
|
+
color,
|
|
41
|
+
now = false,
|
|
42
|
+
contents = [],
|
|
43
|
+
suffix = 'jpeg',
|
|
44
|
+
}) {
|
|
35
45
|
this.isInTailoring = true;
|
|
36
46
|
this.movePointIndex = -1;
|
|
47
|
+
this.imageType = suffix;
|
|
37
48
|
const pointList = getRectPoint({x: left, y: top},
|
|
38
49
|
{x: left + width, y: top + height});
|
|
39
50
|
this.tailoringPoints = [
|
|
@@ -296,7 +307,7 @@ export class Tailoring extends ViewerCommon {
|
|
|
296
307
|
startPoint.y * radioY, disWidth, disHeight, 0, 0, disWidth,
|
|
297
308
|
disHeight);
|
|
298
309
|
}
|
|
299
|
-
return copyCanvas.toDataURL(
|
|
310
|
+
return copyCanvas.toDataURL(`image/${this.imageType || 'jpeg'}`);
|
|
300
311
|
} catch (e) {
|
|
301
312
|
console.error(e);
|
|
302
313
|
}
|