kfb-view 2.3.7 → 2.3.9

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.3.7",
4
+ "version": "2.3.9",
5
5
  "author": "qifeng.fan <qifeng.fan@hzztai.com>",
6
6
  "license": "MIT",
7
7
  "main": "lib/kfb-view.js",
@@ -105,23 +105,12 @@ export class Shape extends ViewerCommon {
105
105
  clearTimeout(this.delaytimer);
106
106
  this.delaytimer = undefined;
107
107
  }
108
- this.deepDrawLabel(sameFixWidthLabel, sameNormalLabel, 1, bounds);
109
- regionLabelList.forEach((item) => {
110
- this.combination.setContent(this.canvas, item);
111
- this.combination.draw({
112
- points: item.viewerElementPoints,
113
- tool: item.tool,
114
- }, item.child.map(({viewerElementPoints, tool}) => ({
115
- points: viewerElementPoints,
116
- tool,
117
- })), this.viewport.getRotation());
118
- });
119
- imageLabel.forEach((item) => {
120
- this.drawLabel(item);
121
- });
108
+ this.deepDrawLabel(sameFixWidthLabel, sameNormalLabel, regionLabelList,
109
+ imageLabel, 1, bounds);
122
110
  }
123
111
 
124
- deepDrawLabel(sameFixWidthLabel, sameNormalLabel, count, bounds) {
112
+ deepDrawLabel(sameFixWidthLabel, sameNormalLabel, regionLabelList,
113
+ imageLabel, count, bounds) {
125
114
  let currentDrawCount = 0; // 当前已绘制数量
126
115
  const ctx = this.canvas.getContext('2d');
127
116
  const remainFixLabel = {};
@@ -173,9 +162,23 @@ export class Shape extends ViewerCommon {
173
162
  Object.keys(remainNormalLabel).length === 0) {
174
163
  console.log(`end deep draw label, draw count: ${count}`);
175
164
  this.delaytimer = undefined;
165
+ regionLabelList.forEach((item) => {
166
+ this.combination.setContent(this.canvas, item);
167
+ this.combination.draw({
168
+ points: item.viewerElementPoints,
169
+ tool: item.tool,
170
+ }, item.child.map(({viewerElementPoints, tool}) => ({
171
+ points: viewerElementPoints,
172
+ tool,
173
+ })), this.viewport.getRotation());
174
+ });
175
+ imageLabel.forEach((item) => {
176
+ this.drawLabel(item);
177
+ });
176
178
  } else {
177
179
  this.delaytimer = setTimeout(() => {
178
- this.deepDrawLabel(remainFixLabel, remainNormalLabel, count + 1,
180
+ this.deepDrawLabel(remainFixLabel, remainNormalLabel, regionLabelList,
181
+ imageLabel, count + 1,
179
182
  bounds);
180
183
  }, 100);
181
184
  }
@@ -111,8 +111,9 @@ export class Tailoring extends ViewerCommon {
111
111
  ctx.fillStyle = this.color;
112
112
  ctx.font = '18px Arial';
113
113
  ctx.fillText(
114
- this.contents?.[3] ?? (`区域大小为:${rightTop.x -
115
- leftTop.x}*${rightBottom.y - rightTop.y}`),
114
+ this.contents?.[2] ?
115
+ this.contents[2](rightTop.x - leftTop.x, rightBottom.y - rightTop.y) :
116
+ (`区域大小为:${rightTop.x - leftTop.x}*${rightBottom.y - rightTop.y}`),
116
117
  leftTop.x, leftTop.y - 50);
117
118
  ctx.fillText(this.contents?.[0] ?? `双击区域内表示完成截图`, leftTop.x,
118
119
  leftTop.y - 30);