kfb-view 3.2.5 → 3.2.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kfb-view",
3
3
  "description": "一个在线kfb的阅片软件",
4
- "version": "3.2.5",
4
+ "version": "3.2.6",
5
5
  "author": "qifeng.fan <qifeng.fan@hzztai.com>",
6
6
  "license": "MIT",
7
7
  "main": "lib/kfb-view.js",
@@ -28,6 +28,7 @@ export class Grid extends ViewerCommon {
28
28
  let currentZoom = this.getImageZoom(true) * this.options.scale;
29
29
  const pxConversion = this.options.pxConversion ?
30
30
  this.options.imageCapRes : 1;
31
+ const binary = Math.pow(this.options.binary, this.options.unitsIndex || 0);
31
32
  let baseScale = this.options.scale === 40 ?
32
33
  (this.options.pxConversion ? 1600 / this.options.imageCapRes : 3200) :
33
34
  (this.options.pxConversion ? 800 / this.options.imageCapRes : 1600);
@@ -95,7 +96,7 @@ export class Grid extends ViewerCommon {
95
96
  ctx.moveTo(point.x + (basePx / 5) * j, 16);
96
97
  ctx.lineTo(point.x + (basePx / 5) * j, 20);
97
98
  if (i !== minX) {
98
- ctx.fillText((i * baseScale * pxConversion).toFixed(0), point.x + 5,
99
+ ctx.fillText((i * baseScale * pxConversion / binary).toFixed(2) / 1, point.x + 5,
99
100
  13);
100
101
  }
101
102
  }
@@ -111,7 +112,7 @@ export class Grid extends ViewerCommon {
111
112
  ctx.save();
112
113
  ctx.translate(3, point.y + 5);
113
114
  ctx.rotate(Math.PI / 2);
114
- ctx.fillText((i * baseScale * pxConversion).toFixed(0), 0, 0);
115
+ ctx.fillText((i * baseScale * pxConversion / binary).toFixed(0), 0, 0);
115
116
  ctx.restore();
116
117
  }
117
118
  }