@inweb/markup 25.8.16 → 25.8.20
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 +86 -25
- package/dist/markup.js.map +1 -1
- package/dist/markup.min.js +1 -1
- package/dist/markup.module.js +81 -15
- package/dist/markup.module.js.map +1 -1
- package/lib/markup/IMarkup.d.ts +33 -29
- package/lib/markup/IMarkupLine.d.ts +1 -1
- package/lib/markup/IWorldTransform.d.ts +2 -2
- package/lib/markup/Konva/KonvaArrow.d.ts +2 -2
- package/lib/markup/Konva/KonvaCloud.d.ts +1 -1
- package/lib/markup/Konva/KonvaEllipse.d.ts +2 -2
- package/lib/markup/Konva/KonvaImage.d.ts +7 -2
- package/lib/markup/Konva/KonvaLine.d.ts +1 -1
- package/lib/markup/Konva/KonvaRectangle.d.ts +1 -1
- package/lib/markup/Konva/KonvaText.d.ts +2 -2
- package/package.json +3 -3
- package/src/markup/IMarkup.ts +33 -29
- package/src/markup/IMarkupLine.ts +1 -1
- package/src/markup/IWorldTransform.ts +2 -2
- package/src/markup/Konva/KonvaArrow.ts +5 -3
- package/src/markup/Konva/KonvaCloud.ts +3 -2
- package/src/markup/Konva/KonvaEllipse.ts +5 -3
- package/src/markup/Konva/KonvaImage.ts +56 -14
- package/src/markup/Konva/KonvaLine.ts +7 -2
- package/src/markup/Konva/KonvaMarkup.ts +2 -0
- package/src/markup/Konva/KonvaRectangle.ts +3 -2
- package/src/markup/Konva/KonvaText.ts +5 -3
|
@@ -12,7 +12,7 @@ export class KonvaLine implements IMarkupLine {
|
|
|
12
12
|
|
|
13
13
|
constructor(
|
|
14
14
|
params: {
|
|
15
|
-
points
|
|
15
|
+
points?: { x: number; y: number }[];
|
|
16
16
|
type?: MarkupLineType;
|
|
17
17
|
width?: number;
|
|
18
18
|
color?: string;
|
|
@@ -25,7 +25,12 @@ export class KonvaLine implements IMarkupLine {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
if (!params
|
|
28
|
+
if (!params) params = {};
|
|
29
|
+
if (!params.points)
|
|
30
|
+
params.points = [
|
|
31
|
+
{ x: 50, y: 50 },
|
|
32
|
+
{ x: 100, y: 100 },
|
|
33
|
+
];
|
|
29
34
|
|
|
30
35
|
const konvaPoints = [];
|
|
31
36
|
params.points.forEach((point) => konvaPoints.push(point.x, point.y));
|
|
@@ -6,7 +6,7 @@ export class KonvaRectangle implements IMarkupRectangle {
|
|
|
6
6
|
|
|
7
7
|
constructor(
|
|
8
8
|
params: {
|
|
9
|
-
position
|
|
9
|
+
position?: { x: number; y: number };
|
|
10
10
|
width?: number;
|
|
11
11
|
height?: number;
|
|
12
12
|
lineWidth?: number;
|
|
@@ -20,7 +20,8 @@ export class KonvaRectangle implements IMarkupRectangle {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
if (!params
|
|
23
|
+
if (!params) params = {};
|
|
24
|
+
if (!params.position) params.position = { x: 100, y: 100 };
|
|
24
25
|
|
|
25
26
|
this._ref = new Konva.Rect({
|
|
26
27
|
stroke: params.color ?? "#ff0000",
|
|
@@ -7,8 +7,8 @@ export class KonvaText implements IMarkupText {
|
|
|
7
7
|
|
|
8
8
|
constructor(
|
|
9
9
|
params: {
|
|
10
|
-
position
|
|
11
|
-
text
|
|
10
|
+
position?: { x: number; y: number };
|
|
11
|
+
text?: string;
|
|
12
12
|
rotation?: number;
|
|
13
13
|
fontSize?: number;
|
|
14
14
|
color?: string;
|
|
@@ -21,7 +21,9 @@ export class KonvaText implements IMarkupText {
|
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
if (!params
|
|
24
|
+
if (!params) params = {};
|
|
25
|
+
if (!params.position) params.position = { x: 100, y: 100 };
|
|
26
|
+
if (!params.text) params.text = "default";
|
|
25
27
|
|
|
26
28
|
this._ref = new Konva.Text({
|
|
27
29
|
x: params.position.x,
|