kfb-view 3.3.1 → 3.3.2
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
|
@@ -271,7 +271,7 @@ export class ViewerCommon {
|
|
|
271
271
|
`${this.translate('long_axis')}:${this.getUnitNumber(a)}`,
|
|
272
272
|
`${this.translate('short_axis')}:${this.getUnitNumber(b)}`,
|
|
273
273
|
`${this.translate('perimeter')}:${this.getUnitNumber(4 * (a - b) + 2 * Math.PI * b)}`,
|
|
274
|
-
`${this.translate('area')}:${this.getUnitNumber(Math.PI * a * b
|
|
274
|
+
`${this.translate('area')}:${this.getUnitNumber(Math.PI * a * b, 2)}²`],
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
277
|
break;
|
|
@@ -279,7 +279,7 @@ export class ViewerCommon {
|
|
|
279
279
|
const w = Math.abs(endPoint.x - startPoint.x) * this.options.imageCapRes;
|
|
280
280
|
const h = Math.abs(endPoint.y - startPoint.y) * this.options.imageCapRes;
|
|
281
281
|
const pt = (w + h) * 2;
|
|
282
|
-
const ac = w * h
|
|
282
|
+
const ac = w * h;
|
|
283
283
|
const rightTop = getRectPoint(startPoint, endPoint)[2];
|
|
284
284
|
const p = this.imageToViewerElementCoordinates(rightTop.x,
|
|
285
285
|
rightTop.y);
|
|
@@ -291,7 +291,7 @@ export class ViewerCommon {
|
|
|
291
291
|
`${this.translate('length')}:${this.getUnitNumber(w)}`,
|
|
292
292
|
`${this.translate('width')}:${this.getUnitNumber(h)}`,
|
|
293
293
|
`${this.translate('perimeter')}:${this.getUnitNumber(pt)}`,
|
|
294
|
-
`${this.translate('area')}:${this.getUnitNumber(ac)}²`],
|
|
294
|
+
`${this.translate('area')}:${this.getUnitNumber(ac, 2)}²`],
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
297
|
break;
|
|
@@ -312,7 +312,7 @@ export class ViewerCommon {
|
|
|
312
312
|
texts: [
|
|
313
313
|
`${this.translate('perimeter')}:${this.getUnitNumber((pt * this.options.imageCapRes).toFixed(2))}`,
|
|
314
314
|
`${this.translate('area')}:${this.getUnitNumber(
|
|
315
|
-
calculatePolygonArea(points, this.options.imageCapRes)
|
|
315
|
+
calculatePolygonArea(points, this.options.imageCapRes), 2)}²`],
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
318
|
break;
|
|
@@ -335,8 +335,9 @@ export class ViewerCommon {
|
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
-
getUnitNumber(number, index) {
|
|
339
|
-
|
|
338
|
+
getUnitNumber(number, index = 1) {
|
|
339
|
+
const binary = Math.pow(this.options.binary, index);
|
|
340
|
+
return getUnitNumber(number, this.options.units, binary);
|
|
340
341
|
}
|
|
341
342
|
|
|
342
343
|
/**
|