kfb-view 2.1.17 → 2.1.18

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kfb-view",
3
3
  "description": "一个在线kfb的阅片软件",
4
- "version": "2.1.17",
4
+ "version": "2.1.18",
5
5
  "author": "qifeng.fan <qifeng.fan@hzztai.com>",
6
6
  "license": "MIT",
7
7
  "main": "lib/kfb-view.js",
@@ -76,11 +76,12 @@ export class Shape extends ViewerCommon {
76
76
  this.labelList.forEach((item) => {
77
77
  if (item.show === false) return;
78
78
  if (!this[item.tool]) return;
79
- const point = this.imageToViewerElementCoordinates(item.points[0].x,
79
+ if (!this.isInCanvas(item.region)) return;
80
+ /* const point = this.imageToViewerElementCoordinates(item.points[0].x,
80
81
  item.points[0].y);
81
82
  if ((point.x > this.canvas.width ||
82
83
  point.y > this.canvas.height ||
83
- point.x < 0 || point.y < 0)) return;
84
+ point.x < 0 || point.y < 0)) return;*/
84
85
  const key = `${item.strokeStyle ?? ''}_${item.lineWidth ??
85
86
  ''}_${item.fillStyle ?? ''}`;
86
87
  const regionKey = `${item.strokeStyle ?? ''}_${item.lineWidth ?? ''}`;
@@ -133,11 +134,12 @@ export class Shape extends ViewerCommon {
133
134
  regionLabelList.forEach((item) => {
134
135
  if (item.show === false) return;
135
136
  if (!this[item.tool]) return;
136
- const point = this.imageToViewerElementCoordinates(item.points[0].x,
137
- item.points[0].y);
138
- if ((point.x > this.canvas.width ||
139
- point.y > this.canvas.height ||
140
- point.x < 0 || point.y < 0)) return;
137
+ if (!this.isInCanvas(item.region)) return;
138
+ /* const point = this.imageToViewerElementCoordinates(item.points[0].x,
139
+ item.points[0].y);
140
+ if ((point.x > this.canvas.width ||
141
+ point.y > this.canvas.height ||
142
+ point.x < 0 || point.y < 0)) return;*/
141
143
  this.combination.setContent(this.canvas, item);
142
144
  this.combination.draw({
143
145
  points: this.imageToViewerElementPoints(item.points),