@inweb/markup 25.7.8 → 25.7.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.
|
@@ -27,9 +27,10 @@ import { ChangeActiveDraggerEvent, IViewpoint, PanEvent } from "@inweb/viewer-co
|
|
|
27
27
|
|
|
28
28
|
import { IMarkup } from "../IMarkup";
|
|
29
29
|
import { IWorldTransform } from "../IWorldTransform";
|
|
30
|
-
import { MarkupColor } from "./MarkupColor";
|
|
31
30
|
import { IMarkupObject } from "../IMarkupObject";
|
|
32
31
|
import { IMarkupColorable } from "../IMarkupColorable";
|
|
32
|
+
import { MarkupLineType } from "../IMarkupLine";
|
|
33
|
+
import { MarkupColor } from "./MarkupColor";
|
|
33
34
|
import { KonvaLine } from "./KonvaLine";
|
|
34
35
|
import { KonvaText } from "./KonvaText";
|
|
35
36
|
import { KonvaRectangle } from "./KonvaRectangle";
|
|
@@ -37,13 +38,6 @@ import { KonvaEllipse } from "./KonvaEllipse";
|
|
|
37
38
|
import { KonvaArrow } from "./KonvaArrow";
|
|
38
39
|
import { KonvaImage } from "./KonvaImage";
|
|
39
40
|
import { KonvaCloud } from "./KonvaCloud";
|
|
40
|
-
import { IMarkupLine, MarkupLineType } from "../IMarkupLine";
|
|
41
|
-
import { IMarkupArrow } from "../IMarkupArrow";
|
|
42
|
-
import { IMarkupEllipse } from "../IMarkupEllipse";
|
|
43
|
-
import { IMarkupRectangle } from "../IMarkupRectangle";
|
|
44
|
-
import { IMarkupCloud } from "../IMarkupCloud";
|
|
45
|
-
import { IMarkupImage } from "../IMarkupImage";
|
|
46
|
-
import { IMarkupText } from "../IMarkupText";
|
|
47
41
|
|
|
48
42
|
const MarkupMode2Konva = {
|
|
49
43
|
SelectMarkup: {
|
|
@@ -946,8 +940,9 @@ export class KonvaMarkup implements IMarkup {
|
|
|
946
940
|
type?: MarkupLineType,
|
|
947
941
|
width?: number,
|
|
948
942
|
id?: string
|
|
949
|
-
):
|
|
943
|
+
): KonvaLine | void {
|
|
950
944
|
if (!linePoints || linePoints.length === 0) return;
|
|
945
|
+
|
|
951
946
|
const points: { x: number; y: number }[] = [];
|
|
952
947
|
for (let i = 0; i < linePoints.length; i += 2) {
|
|
953
948
|
points.push({ x: linePoints[i], y: linePoints[i + 1] });
|
|
@@ -1058,7 +1053,7 @@ export class KonvaMarkup implements IMarkup {
|
|
|
1058
1053
|
textSize?: number,
|
|
1059
1054
|
fontSize?: number,
|
|
1060
1055
|
id?: string
|
|
1061
|
-
):
|
|
1056
|
+
): KonvaText | void {
|
|
1062
1057
|
const trNodes = this._konvaTransformer.nodes();
|
|
1063
1058
|
if (trNodes.length > 0) {
|
|
1064
1059
|
// in case of edit - remove old Konva.Text object
|
|
@@ -1099,7 +1094,7 @@ export class KonvaMarkup implements IMarkup {
|
|
|
1099
1094
|
lineWidth?: number,
|
|
1100
1095
|
color?: string,
|
|
1101
1096
|
id?: string
|
|
1102
|
-
):
|
|
1097
|
+
): KonvaRectangle | void {
|
|
1103
1098
|
if (!position) return;
|
|
1104
1099
|
|
|
1105
1100
|
const konvaRectangle = new KonvaRectangle({
|
|
@@ -1122,7 +1117,7 @@ export class KonvaMarkup implements IMarkup {
|
|
|
1122
1117
|
lineWidth?: number,
|
|
1123
1118
|
color?: string,
|
|
1124
1119
|
id?: string
|
|
1125
|
-
):
|
|
1120
|
+
): KonvaEllipse | void {
|
|
1126
1121
|
if (!position) return;
|
|
1127
1122
|
|
|
1128
1123
|
const konvaEllipse = new KonvaEllipse({
|
|
@@ -1143,7 +1138,7 @@ export class KonvaMarkup implements IMarkup {
|
|
|
1143
1138
|
end: { x: number; y: number },
|
|
1144
1139
|
color?: string,
|
|
1145
1140
|
id?: string
|
|
1146
|
-
):
|
|
1141
|
+
): KonvaArrow | void {
|
|
1147
1142
|
if (!start || !end) return;
|
|
1148
1143
|
|
|
1149
1144
|
const konvaArrow = new KonvaArrow({
|
|
@@ -1165,7 +1160,7 @@ export class KonvaMarkup implements IMarkup {
|
|
|
1165
1160
|
lineWidth?: number,
|
|
1166
1161
|
color?: string,
|
|
1167
1162
|
id?: string
|
|
1168
|
-
):
|
|
1163
|
+
): KonvaCloud | void {
|
|
1169
1164
|
if (!position || !width || !height) return;
|
|
1170
1165
|
|
|
1171
1166
|
const konvaCloud = new KonvaCloud({
|
|
@@ -1188,10 +1183,10 @@ export class KonvaMarkup implements IMarkup {
|
|
|
1188
1183
|
width?: number,
|
|
1189
1184
|
height?: number,
|
|
1190
1185
|
id?: string
|
|
1191
|
-
):
|
|
1186
|
+
): KonvaImage | void {
|
|
1192
1187
|
if (!position) return;
|
|
1193
1188
|
|
|
1194
|
-
let konvaImage:
|
|
1189
|
+
let konvaImage: KonvaImage;
|
|
1195
1190
|
|
|
1196
1191
|
if (src) {
|
|
1197
1192
|
konvaImage = new KonvaImage({
|