@inweb/viewer-visualize 25.8.15 → 25.8.16
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.8.
|
|
3
|
+
"version": "25.8.16",
|
|
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,10 +29,10 @@
|
|
|
29
29
|
"docs": "typedoc"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@inweb/client": "~25.8.
|
|
33
|
-
"@inweb/eventemitter2": "~25.8.
|
|
34
|
-
"@inweb/markup": "~25.8.
|
|
35
|
-
"@inweb/viewer-core": "~25.8.
|
|
32
|
+
"@inweb/client": "~25.8.16",
|
|
33
|
+
"@inweb/eventemitter2": "~25.8.16",
|
|
34
|
+
"@inweb/markup": "~25.8.16",
|
|
35
|
+
"@inweb/viewer-core": "~25.8.16"
|
|
36
36
|
},
|
|
37
37
|
"visualizeJS": "https://opencloud.azureedge.net/libs/visualizejs/master/Visualize.js"
|
|
38
38
|
}
|
package/src/Viewer/Viewer.ts
CHANGED
|
@@ -776,12 +776,16 @@ export class Viewer
|
|
|
776
776
|
screenToWorld(position: { x: number; y: number }): { x: number; y: number; z: number } {
|
|
777
777
|
if (!this.visualizeJs) return { x: position.x, y: position.y, z: 0 };
|
|
778
778
|
|
|
779
|
-
const
|
|
779
|
+
const activeView = this.visViewer().activeView;
|
|
780
|
+
const worldPoint = activeView.transformScreenToWorld(
|
|
780
781
|
position.x * window.devicePixelRatio,
|
|
781
782
|
position.y * window.devicePixelRatio
|
|
782
783
|
);
|
|
784
|
+
|
|
783
785
|
const result = { x: worldPoint[0], y: worldPoint[1], z: worldPoint[2] };
|
|
784
786
|
|
|
787
|
+
activeView.delete();
|
|
788
|
+
|
|
785
789
|
return result;
|
|
786
790
|
}
|
|
787
791
|
|
|
@@ -789,15 +793,10 @@ export class Viewer
|
|
|
789
793
|
if (!this.visualizeJs) return { x: position.x, y: position.y };
|
|
790
794
|
|
|
791
795
|
const activeView = this.visViewer().activeView;
|
|
792
|
-
const
|
|
793
|
-
const worldPoint = this.visLib().Point3d.createFromArray([position.x, position.y, position.z]);
|
|
796
|
+
const devicePoint = activeView.transformWorldToScreen(position.x, position.y, position.z);
|
|
794
797
|
|
|
795
|
-
const
|
|
796
|
-
const result = { x: devicePoint.x / window.devicePixelRatio, y: devicePoint.y / window.devicePixelRatio };
|
|
798
|
+
const result = { x: devicePoint[0] / window.devicePixelRatio, y: devicePoint[1] / window.devicePixelRatio };
|
|
797
799
|
|
|
798
|
-
devicePoint.delete();
|
|
799
|
-
worldPoint.delete();
|
|
800
|
-
worldMatrix.delete();
|
|
801
800
|
activeView.delete();
|
|
802
801
|
|
|
803
802
|
return result;
|