@inweb/viewer-visualize 25.4.10 → 25.4.11
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/viewer-visualize.js +22 -27
- package/dist/viewer-visualize.js.map +1 -1
- package/dist/viewer-visualize.min.js +1 -1
- package/dist/viewer-visualize.module.js +20 -25
- package/dist/viewer-visualize.module.js.map +1 -1
- package/package.json +5 -5
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaText.ts +2 -4
- package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +22 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/viewer-visualize",
|
|
3
|
-
"version": "25.4.
|
|
3
|
+
"version": "25.4.11",
|
|
4
4
|
"description": "3D CAD and BIM data Viewer powered by Visualize",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"ts-docs": "typedoc"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@inweb/client": "~25.4.
|
|
33
|
-
"@inweb/eventemitter2": "~25.4.
|
|
34
|
-
"@inweb/viewer-core": "~25.4.
|
|
32
|
+
"@inweb/client": "~25.4.7",
|
|
33
|
+
"@inweb/eventemitter2": "~25.4.7",
|
|
34
|
+
"@inweb/viewer-core": "~25.4.7"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"canvas": "^2.11.2",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"canvas": "^2.11.2",
|
|
42
42
|
"konva": "^9.2.0"
|
|
43
43
|
},
|
|
44
|
-
"visualizeJS": "https://opencloud.azureedge.net/libs/visualizejs/
|
|
44
|
+
"visualizeJS": "https://opencloud.azureedge.net/libs/visualizejs/25.4/Visualize.js"
|
|
45
45
|
}
|
|
@@ -36,8 +36,6 @@ export class KonvaText implements IMarkupText, IMarkupColorable {
|
|
|
36
36
|
rotation: params.rotation ?? 0,
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
this._ref.width(this._ref.getTextWidth());
|
|
40
|
-
|
|
41
39
|
this._ref.on("transform", (e) => {
|
|
42
40
|
const attrs = e.target.attrs;
|
|
43
41
|
|
|
@@ -47,11 +45,11 @@ export class KonvaText implements IMarkupText, IMarkupColorable {
|
|
|
47
45
|
const newHeight = this._ref.height() * attrs.scaleY;
|
|
48
46
|
|
|
49
47
|
if (Math.abs(attrs.scaleX - 1) > 10e-6) {
|
|
50
|
-
this._ref.width(
|
|
48
|
+
this.setFontSize(Math.round((this.getFontSize() * newWidth) / this._ref.width()));
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
if (Math.abs(attrs.scaleY - 1) > 10e-6) {
|
|
54
|
-
this._ref.height(
|
|
52
|
+
this.setFontSize(Math.round((this.getFontSize() * newHeight) / this._ref.height()));
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
this._ref.scale({ x: 1, y: 1 });
|
|
@@ -656,33 +656,29 @@ export class KonvaMarkup implements IMarkup {
|
|
|
656
656
|
return;
|
|
657
657
|
}
|
|
658
658
|
|
|
659
|
-
if (
|
|
660
|
-
if (
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
this.removeTextInput();
|
|
674
|
-
}
|
|
659
|
+
if (e.target.className === "Text" && transformer.nodes().length === 1 && transformer.nodes()[0] === e.target) {
|
|
660
|
+
if (this._textInputRef && this._textInputRef.value)
|
|
661
|
+
this.addText(this._textInputRef.value, this._textInputPos, this._textInputAngle);
|
|
662
|
+
else
|
|
663
|
+
this.createTextInput(
|
|
664
|
+
{ x: e.target.attrs.x, y: e.target.attrs.y },
|
|
665
|
+
e.evt.pageX,
|
|
666
|
+
e.evt.pageY,
|
|
667
|
+
e.target.attrs.rotation,
|
|
668
|
+
e.target.attrs.text
|
|
669
|
+
);
|
|
670
|
+
return;
|
|
671
|
+
} else {
|
|
672
|
+
this.removeTextInput();
|
|
675
673
|
}
|
|
676
674
|
|
|
677
|
-
if (
|
|
678
|
-
if (
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
this.removeImageInput();
|
|
685
|
-
}
|
|
675
|
+
if (e.target.className === "Image" && transformer.nodes().length === 1 && transformer.nodes()[0] === e.target) {
|
|
676
|
+
if (this._imageInputRef && this._imageInputRef.value)
|
|
677
|
+
this.addImage(this._imageInputPos, this._imageInputRef.value, 0, 0);
|
|
678
|
+
else this.createImageInput({ x: e.target.attrs.x, y: e.target.attrs.y });
|
|
679
|
+
return;
|
|
680
|
+
} else {
|
|
681
|
+
this.removeImageInput();
|
|
686
682
|
}
|
|
687
683
|
|
|
688
684
|
if (transformer.nodes().filter((x) => x.className === "Cloud").length > 0 || e.target.className === "Cloud") {
|
|
@@ -1077,7 +1073,7 @@ export class KonvaMarkup implements IMarkup {
|
|
|
1077
1073
|
this._textInputRef.style.top = inputY + "px";
|
|
1078
1074
|
this._textInputRef.style.left = inputX + "px";
|
|
1079
1075
|
this._textInputRef.onkeydown = (event) => {
|
|
1080
|
-
if (event.key === "Enter"
|
|
1076
|
+
if (event.key === "Enter") {
|
|
1081
1077
|
event.preventDefault();
|
|
1082
1078
|
this.addText(this._textInputRef.value, this._textInputPos, this._textInputAngle);
|
|
1083
1079
|
}
|