kfb-view 2.3.4 → 2.3.5
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 +9 -2
- package/lib/kfb-view.js +1 -1
- package/package.json +1 -1
- package/src/components/tailoring/index.js +10 -4
package/package.json
CHANGED
|
@@ -27,9 +27,10 @@ export class Tailoring extends ViewerCommon {
|
|
|
27
27
|
this.tailoringPoints = [];
|
|
28
28
|
this.movePointIndex = -1;
|
|
29
29
|
this.color = '#FFF';
|
|
30
|
+
this.contents = [];
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
init({width, height, left, top, color, now = false}) {
|
|
33
|
+
init({width, height, left, top, color, now = false, contents = []}) {
|
|
33
34
|
this.isInTailoring = true;
|
|
34
35
|
this.movePointIndex = -1;
|
|
35
36
|
const pointList = getRectPoint({x: left, y: top},
|
|
@@ -44,6 +45,8 @@ export class Tailoring extends ViewerCommon {
|
|
|
44
45
|
this.stopTailoring();
|
|
45
46
|
} else {
|
|
46
47
|
this.color = color || '#FFF';
|
|
48
|
+
this.contents = contents?.length ||
|
|
49
|
+
['双击区域内表示完成截图', '双击区域外或按ESC表示取消截图'];
|
|
47
50
|
this.change();
|
|
48
51
|
}
|
|
49
52
|
}
|
|
@@ -107,10 +110,13 @@ export class Tailoring extends ViewerCommon {
|
|
|
107
110
|
ctx.fillStyle = this.color;
|
|
108
111
|
ctx.font = '18px Arial';
|
|
109
112
|
ctx.fillText(
|
|
110
|
-
`区域大小为:${rightTop.x -
|
|
113
|
+
this.contents?.[3] ?? (`区域大小为:${rightTop.x -
|
|
114
|
+
leftTop.x}*${rightBottom.y - rightTop.y}`),
|
|
111
115
|
leftTop.x, leftTop.y - 50);
|
|
112
|
-
ctx.fillText(`双击区域内表示完成截图`, leftTop.x,
|
|
113
|
-
|
|
116
|
+
ctx.fillText(this.contents?.[0] ?? `双击区域内表示完成截图`, leftTop.x,
|
|
117
|
+
leftTop.y - 30);
|
|
118
|
+
ctx.fillText(this.contents?.[1] ?? `双击区域外或按ESC表示取消截图`, leftTop.x,
|
|
119
|
+
leftTop.y - 10);
|
|
114
120
|
ctx.stroke();
|
|
115
121
|
}
|
|
116
122
|
|