@inweb/viewer-visualize 25.4.11 → 25.5.4

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/viewer-visualize",
3
- "version": "25.4.11",
3
+ "version": "25.5.4",
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.7",
33
- "@inweb/eventemitter2": "~25.4.7",
34
- "@inweb/viewer-core": "~25.4.7"
32
+ "@inweb/client": "~25.4.10",
33
+ "@inweb/eventemitter2": "~25.4.10",
34
+ "@inweb/viewer-core": "~25.4.10"
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/25.4/Visualize.js"
44
+ "visualizeJS": "https://opencloud.azureedge.net/libs/visualizejs/master/Visualize.js"
45
45
  }
@@ -36,6 +36,8 @@ export class KonvaText implements IMarkupText, IMarkupColorable {
36
36
  rotation: params.rotation ?? 0,
37
37
  });
38
38
 
39
+ this._ref.width(this._ref.getTextWidth());
40
+
39
41
  this._ref.on("transform", (e) => {
40
42
  const attrs = e.target.attrs;
41
43
 
@@ -45,11 +47,11 @@ export class KonvaText implements IMarkupText, IMarkupColorable {
45
47
  const newHeight = this._ref.height() * attrs.scaleY;
46
48
 
47
49
  if (Math.abs(attrs.scaleX - 1) > 10e-6) {
48
- this.setFontSize(Math.round((this.getFontSize() * newWidth) / this._ref.width()));
50
+ this._ref.width(newWidth);
49
51
  }
50
52
 
51
53
  if (Math.abs(attrs.scaleY - 1) > 10e-6) {
52
- this.setFontSize(Math.round((this.getFontSize() * newHeight) / this._ref.height()));
54
+ this._ref.height(newHeight);
53
55
  }
54
56
 
55
57
  this._ref.scale({ x: 1, y: 1 });
@@ -656,29 +656,33 @@ export class KonvaMarkup implements IMarkup {
656
656
  return;
657
657
  }
658
658
 
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();
659
+ if (this._markupMode === MarkupMode.Text) {
660
+ if (e.target.className === "Text" && transformer.nodes().length === 1 && transformer.nodes()[0] === e.target) {
661
+ if (this._textInputRef && this._textInputRef.value)
662
+ this.addText(this._textInputRef.value, this._textInputPos, this._textInputAngle);
663
+ else
664
+ this.createTextInput(
665
+ { x: e.target.attrs.x, y: e.target.attrs.y },
666
+ e.evt.pageX,
667
+ e.evt.pageY,
668
+ e.target.attrs.rotation,
669
+ e.target.attrs.text
670
+ );
671
+ return;
672
+ } else {
673
+ this.removeTextInput();
674
+ }
673
675
  }
674
676
 
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();
677
+ if (this._markupMode === MarkupMode.Image) {
678
+ if (e.target.className === "Image" && transformer.nodes().length === 1 && transformer.nodes()[0] === e.target) {
679
+ if (this._imageInputRef && this._imageInputRef.value)
680
+ this.addImage(this._imageInputPos, this._imageInputRef.value, 0, 0);
681
+ else this.createImageInput({ x: e.target.attrs.x, y: e.target.attrs.y });
682
+ return;
683
+ } else {
684
+ this.removeImageInput();
685
+ }
682
686
  }
683
687
 
684
688
  if (transformer.nodes().filter((x) => x.className === "Cloud").length > 0 || e.target.className === "Cloud") {
@@ -1073,7 +1077,7 @@ export class KonvaMarkup implements IMarkup {
1073
1077
  this._textInputRef.style.top = inputY + "px";
1074
1078
  this._textInputRef.style.left = inputX + "px";
1075
1079
  this._textInputRef.onkeydown = (event) => {
1076
- if (event.key === "Enter") {
1080
+ if (event.key === "Enter" && !event.shiftKey) {
1077
1081
  event.preventDefault();
1078
1082
  this.addText(this._textInputRef.value, this._textInputPos, this._textInputAngle);
1079
1083
  }