kfb-view 2.4.0 → 3.0.0-beta1

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.
@@ -1,9 +1,9 @@
1
- //! Built on 2020-03-05
1
+ //! Built on 2022-12-16
2
2
 
3
- //! Git commit: v2.4.2-0-c450749
3
+ //! Git commit: v4.0.0-0-8e6196a
4
4
 
5
5
  //! License: http://openseadragon.github.io/license/
6
6
 
7
7
  //! http://openseadragon.github.io
8
8
 
9
- //! openseadragon 2.4.2
9
+ //! openseadragon 4.0.0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kfb-view",
3
3
  "description": "一个在线kfb的阅片软件",
4
- "version": "2.4.0",
4
+ "version": "3.0.0-beta1",
5
5
  "author": "qifeng.fan <qifeng.fan@hzztai.com>",
6
6
  "license": "MIT",
7
7
  "main": "lib/kfb-view.js",
@@ -60,8 +60,8 @@ export class ViewerCommon extends EventEmitter {
60
60
  {x: rect.x + rect.width, y: rect.y + rect.height})[4];
61
61
  }
62
62
 
63
- moveToLabel(point) {
64
- this.viewport.panTo(new Point(point.x, point.y), false);
63
+ moveToLabel(point, flag = false) {
64
+ this.viewport.panTo(new Point(point.x, point.y), flag);
65
65
  }
66
66
 
67
67
  /**
@@ -110,10 +110,12 @@ export class Tailoring extends ViewerCommon {
110
110
  ctx.beginPath();
111
111
  ctx.fillStyle = this.color;
112
112
  ctx.font = '18px Arial';
113
+ const width = (rightTop.x - leftTop.x).toFixed(2) / 1;
114
+ const height = (rightBottom.y - rightTop.y).toFixed(2) / 1;
113
115
  ctx.fillText(
114
116
  this.contents?.[2] ?
115
- this.contents[2](rightTop.x - leftTop.x, rightBottom.y - rightTop.y) :
116
- (`区域大小为:${rightTop.x - leftTop.x}*${rightBottom.y - rightTop.y}`),
117
+ this.contents[2](width, height) :
118
+ (`区域大小为:${width}*${height}`),
117
119
  leftTop.x, leftTop.y - 50);
118
120
  ctx.fillText(this.contents?.[0] ?? `双击区域内表示完成截图`, leftTop.x,
119
121
  leftTop.y - 30);