kfb-view 2.2.7 → 2.2.8

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.2.7",
4
+ "version": "2.2.8",
5
5
  "author": "qifeng.fan <qifeng.fan@hzztai.com>",
6
6
  "license": "MIT",
7
7
  "main": "lib/kfb-view.js",
@@ -11,6 +11,7 @@ import {
11
11
  EVENT_IN_PAINTING,
12
12
  } from '../../const/event';
13
13
  import {
14
+ getAngle,
14
15
  getDistance,
15
16
  pointInOtherPoint,
16
17
  pointsToRegion,
@@ -344,7 +345,18 @@ export class Board extends ViewerCommon {
344
345
  if (index === 0) return true;
345
346
  if (index === this.points.length - 1) return true;
346
347
  if (pointInOtherPoint(firstPoint, _p, 30)) {
347
- return false;
348
+ const nextPoint = points[index + 1];
349
+ if (nextPoint) {
350
+ const deg = Math.abs(getAngle(_p, firstPoint, nextPoint));
351
+ const angle = deg * 180 / Math.PI;
352
+ if (angle < 90) {
353
+ firstPoint = _p;
354
+ return true;
355
+ }
356
+ return false;
357
+ } else {
358
+ return false;
359
+ }
348
360
  } else {
349
361
  firstPoint = _p;
350
362
  return true;
@@ -17344,6 +17344,7 @@ function OpenSeadragon(options) {
17344
17344
  sourceHeight: sourceHeight,
17345
17345
  position: position,
17346
17346
  size: size,
17347
+ pixelDensityRatio: $.pixelDensityRatio,
17347
17348
  });
17348
17349
  /* context.drawImage(
17349
17350
  rendered.canvas,
package/src/tool/Brush.js CHANGED
@@ -74,7 +74,7 @@ class Brush {
74
74
  ctx.beginPath();
75
75
  ctx.translate(left, top);
76
76
  ctx.rotate(angle);
77
- ctx.scale(scale, scale);
77
+ // ctx.scale(scale, scale);
78
78
  const widthList = [];
79
79
  ctx.font = `${this.options.measure.fontSize}px Arial`;
80
80
  texts.forEach((info) => {