kfb-view 3.3.3 → 3.3.5

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.3.3",
4
+ "version": "3.3.5",
5
5
  "author": "qifeng.fan <qifeng.fan@hzztai.com>",
6
6
  "license": "MIT",
7
7
  "main": "lib/kfb-view.cjs.js",
@@ -37,6 +37,7 @@ export class Tailoring extends ViewerCommon {
37
37
  shape: true,
38
38
  ...this.options,
39
39
  };
40
+ this.custom = undefined;
40
41
  }
41
42
 
42
43
  init({
@@ -47,7 +48,7 @@ export class Tailoring extends ViewerCommon {
47
48
  color,
48
49
  now = false,
49
50
  contents = [],
50
- }) {
51
+ }, custom) {
51
52
  this.isInTailoring = true;
52
53
  this.movePointIndex = -1;
53
54
  const pointList = getRectPoint({x: left, y: top},
@@ -57,6 +58,7 @@ export class Tailoring extends ViewerCommon {
57
58
  pointList[2],
58
59
  pointList[6],
59
60
  pointList[8]];
61
+ this.custom = custom;
60
62
  if (now) {
61
63
  this.emitScreenShot();
62
64
  this.stopTailoring();
@@ -322,6 +324,7 @@ export class Tailoring extends ViewerCommon {
322
324
  width: this.tailoringPoints[3].x - this.tailoringPoints[0].x,
323
325
  height: this.tailoringPoints[3].y - this.tailoringPoints[0].y,
324
326
  }),
327
+ custom: this.custom,
325
328
  });
326
329
  }
327
330
 
@@ -384,7 +387,7 @@ export class Tailoring extends ViewerCommon {
384
387
  const shapeCanvas = this.kv.shape?.canvas;
385
388
  if (shapeCanvas && this.options.shape) {
386
389
  copyCtx.drawImage(shapeCanvas, startPoint.x,
387
- startPoint.y, disWidth, disHeight, 0, 0, disWidth,
390
+ startPoint.y, Math.abs(endPoint.x - startPoint.x), Math.abs(endPoint.y - startPoint.y), 0, 0, disWidth,
388
391
  disHeight);
389
392
  }
390
393
  if (copyCanvas.width > this.options.resolution) {