@inweb/markup 25.8.7 → 25.8.9
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/dist/markup.js +11 -10
- package/dist/markup.js.map +1 -1
- package/dist/markup.min.js +1 -1
- package/dist/markup.module.js +11 -10
- package/dist/markup.module.js.map +1 -1
- package/lib/markup/Konva/KonvaImage.d.ts +2 -2
- package/package.json +3 -3
- package/src/markup/Konva/KonvaArrow.ts +1 -1
- package/src/markup/Konva/KonvaCloud.ts +1 -1
- package/src/markup/Konva/KonvaEllipse.ts +1 -1
- package/src/markup/Konva/KonvaImage.ts +11 -4
- package/src/markup/Konva/KonvaLine.ts +8 -2
- package/src/markup/Konva/KonvaMarkup.ts +1 -1
- package/src/markup/Konva/KonvaRectangle.ts +1 -1
- package/src/markup/Konva/KonvaText.ts +1 -1
|
@@ -7,7 +7,13 @@ export class KonvaImage implements IMarkupImage {
|
|
|
7
7
|
private _ratio = 1;
|
|
8
8
|
|
|
9
9
|
constructor(
|
|
10
|
-
params: {
|
|
10
|
+
params: {
|
|
11
|
+
position: { x: number; y: number };
|
|
12
|
+
src: string;
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
id?: string;
|
|
16
|
+
},
|
|
11
17
|
ref = null
|
|
12
18
|
) {
|
|
13
19
|
if (ref) {
|
|
@@ -19,15 +25,16 @@ export class KonvaImage implements IMarkupImage {
|
|
|
19
25
|
return;
|
|
20
26
|
}
|
|
21
27
|
|
|
22
|
-
if (!params.position || !params.src) return;
|
|
28
|
+
if (!params || !params.position || !params.src) return;
|
|
29
|
+
|
|
23
30
|
this._canvasImage = new Image();
|
|
24
31
|
|
|
25
32
|
this._ref = new Konva.Image({
|
|
26
33
|
x: params.position.x,
|
|
27
34
|
y: params.position.y,
|
|
28
35
|
image: this._canvasImage,
|
|
29
|
-
width: params.width,
|
|
30
|
-
height: params.height,
|
|
36
|
+
width: params.width ?? 0,
|
|
37
|
+
height: params.height ?? 0,
|
|
31
38
|
draggable: true,
|
|
32
39
|
});
|
|
33
40
|
|
|
@@ -11,7 +11,13 @@ export class KonvaLine implements IMarkupLine {
|
|
|
11
11
|
private _ref: Konva.Line;
|
|
12
12
|
|
|
13
13
|
constructor(
|
|
14
|
-
params: {
|
|
14
|
+
params: {
|
|
15
|
+
points: { x: number; y: number }[];
|
|
16
|
+
type?: MarkupLineType;
|
|
17
|
+
width?: number;
|
|
18
|
+
color?: string;
|
|
19
|
+
id?: string;
|
|
20
|
+
},
|
|
15
21
|
ref = null
|
|
16
22
|
) {
|
|
17
23
|
if (ref) {
|
|
@@ -19,7 +25,7 @@ export class KonvaLine implements IMarkupLine {
|
|
|
19
25
|
return;
|
|
20
26
|
}
|
|
21
27
|
|
|
22
|
-
if (!params.points) return;
|
|
28
|
+
if (!params || !params.points) return;
|
|
23
29
|
|
|
24
30
|
const konvaPoints = [];
|
|
25
31
|
params.points.forEach((point) => konvaPoints.push(point.x, point.y));
|