kfb-view 3.0.4 → 3.0.6
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/package.json
CHANGED
|
@@ -277,8 +277,8 @@ export class Board extends ViewerCommon {
|
|
|
277
277
|
this.$emit(EVENT_END_PAINTING, this.getPaintOptions());
|
|
278
278
|
// 是否只绘制一次
|
|
279
279
|
if (this[this.tool].options.once) {
|
|
280
|
-
this.endDraw();
|
|
281
280
|
this.$emit(EVENT_STOP_PAINTING, this.getPaintOptions());
|
|
281
|
+
this.endDraw();
|
|
282
282
|
} else if (this[this.tool].options.clear) { // 是否结束绘画时清空画布
|
|
283
283
|
this.points = [];
|
|
284
284
|
this.clearCanvas();
|
|
@@ -376,6 +376,7 @@ export class Board extends ViewerCommon {
|
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
getPaintOptions() {
|
|
379
|
+
console.log(this.tool);
|
|
379
380
|
const form = new LabelModel({
|
|
380
381
|
...this[this.tool].options,
|
|
381
382
|
points: this.points,
|
|
@@ -168,10 +168,10 @@ export class Shape extends ViewerCommon {
|
|
|
168
168
|
regionLabelList.forEach((item) => {
|
|
169
169
|
this.combination.setContent(this.canvas, item);
|
|
170
170
|
this.combination.draw({
|
|
171
|
-
points: item.
|
|
171
|
+
points: this.imageToViewerElementPoints(item.points),
|
|
172
172
|
tool: item.tool,
|
|
173
|
-
}, item.child.map(({
|
|
174
|
-
points:
|
|
173
|
+
}, item.child.map(({points, tool}) => ({
|
|
174
|
+
points: this.imageToViewerElementPoints(points),
|
|
175
175
|
tool,
|
|
176
176
|
})), this.viewport.getRotation());
|
|
177
177
|
});
|
|
@@ -56,7 +56,15 @@ export class Tailoring extends ViewerCommon {
|
|
|
56
56
|
pointList[6],
|
|
57
57
|
pointList[8]];
|
|
58
58
|
if (now) {
|
|
59
|
-
this
|
|
59
|
+
this.emitTailoringRegion();
|
|
60
|
+
this.$emit(EVENT_TAILORING_SCREENSHOT, {
|
|
61
|
+
base64: this.getScreenCanvasImage(),
|
|
62
|
+
region: this.viewerElementToImageRectangle({
|
|
63
|
+
x: this.tailoringPoints[0].x, y: this.tailoringPoints[0].y,
|
|
64
|
+
width: this.tailoringPoints[3].x - this.tailoringPoints[0].x,
|
|
65
|
+
height: this.tailoringPoints[3].y - this.tailoringPoints[0].y,
|
|
66
|
+
}),
|
|
67
|
+
});
|
|
60
68
|
this.stopTailoring();
|
|
61
69
|
} else {
|
|
62
70
|
this.color = color || '#FFF';
|
|
@@ -253,7 +261,15 @@ export class Tailoring extends ViewerCommon {
|
|
|
253
261
|
|
|
254
262
|
onCanvasDblClick(position) {
|
|
255
263
|
if (this.tailoringPoints.length > 0 && this.isPointInMatrix(position)) {
|
|
256
|
-
this
|
|
264
|
+
this.emitTailoringRegion();
|
|
265
|
+
this.$emit(EVENT_TAILORING_SCREENSHOT, {
|
|
266
|
+
base64: this.getScreenCanvasImage(),
|
|
267
|
+
region: this.viewerElementToImageRectangle({
|
|
268
|
+
x: this.tailoringPoints[0].x, y: this.tailoringPoints[0].y,
|
|
269
|
+
width: this.tailoringPoints[3].x - this.tailoringPoints[0].x,
|
|
270
|
+
height: this.tailoringPoints[3].y - this.tailoringPoints[0].y,
|
|
271
|
+
}),
|
|
272
|
+
});
|
|
257
273
|
}
|
|
258
274
|
this.stopTailoring();
|
|
259
275
|
}
|