kfb-view 2.3.5 → 2.3.7
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
|
@@ -153,6 +153,8 @@ export class Area extends ViewerCommon {
|
|
|
153
153
|
let selectList = [];
|
|
154
154
|
let selectLabel;
|
|
155
155
|
let prevSelectLabel = undefined;
|
|
156
|
+
const bounds = this.viewport.viewportToImageRectangle(
|
|
157
|
+
this.viewport.getBounds());
|
|
156
158
|
this.labelList.forEach((item) => {
|
|
157
159
|
if (item.tool === IMAGE) {
|
|
158
160
|
return;
|
|
@@ -165,6 +167,8 @@ export class Area extends ViewerCommon {
|
|
|
165
167
|
if (this.movePoint) {
|
|
166
168
|
return;
|
|
167
169
|
}
|
|
170
|
+
// 不在可见区域内的标注都过滤掉
|
|
171
|
+
if (!this.isInCanvas(item.region, bounds)) return false;
|
|
168
172
|
let moveIndex = -1; // 可移动点位置
|
|
169
173
|
let pointList = []; // 可移动点的集合
|
|
170
174
|
const scale = this.getImageZoom(true) / item.scale;
|
|
@@ -323,7 +327,7 @@ export class Area extends ViewerCommon {
|
|
|
323
327
|
onCanvasMove({x, y}) {
|
|
324
328
|
const selectLabel = this.labelList.find(
|
|
325
329
|
({tool, select}) => tool === RECTANGLE && select);
|
|
326
|
-
if (selectLabel) {
|
|
330
|
+
if (selectLabel && !this.movePoint) {
|
|
327
331
|
const region = this.imageToViewerElementRectangle(selectLabel.region);
|
|
328
332
|
if (this.isContainerInRegion({x, y}, {
|
|
329
333
|
...selectLabel,
|
|
@@ -45,7 +45,8 @@ export class Tailoring extends ViewerCommon {
|
|
|
45
45
|
this.stopTailoring();
|
|
46
46
|
} else {
|
|
47
47
|
this.color = color || '#FFF';
|
|
48
|
-
this.contents = contents?.length
|
|
48
|
+
this.contents = contents?.length ?
|
|
49
|
+
contents :
|
|
49
50
|
['双击区域内表示完成截图', '双击区域外或按ESC表示取消截图'];
|
|
50
51
|
this.change();
|
|
51
52
|
}
|
|
@@ -115,7 +116,8 @@ export class Tailoring extends ViewerCommon {
|
|
|
115
116
|
leftTop.x, leftTop.y - 50);
|
|
116
117
|
ctx.fillText(this.contents?.[0] ?? `双击区域内表示完成截图`, leftTop.x,
|
|
117
118
|
leftTop.y - 30);
|
|
118
|
-
ctx.fillText(this.contents?.[1] ?? `双击区域外或按ESC表示取消截图`,
|
|
119
|
+
ctx.fillText(this.contents?.[1] ?? `双击区域外或按ESC表示取消截图`,
|
|
120
|
+
leftTop.x,
|
|
119
121
|
leftTop.y - 10);
|
|
120
122
|
ctx.stroke();
|
|
121
123
|
}
|