@itwin/core-frontend 3.4.0-dev.34 → 3.4.0-dev.37
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/lib/cjs/AccuSnap.d.ts.map +1 -1
- package/lib/cjs/AccuSnap.js +10 -24
- package/lib/cjs/AccuSnap.js.map +1 -1
- package/lib/cjs/ViewState.d.ts +36 -12
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +31 -24
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +5 -4
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.js +14 -11
- package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.js +10 -16
- package/lib/cjs/tile/TileDrawArgs.js.map +1 -1
- package/lib/cjs/tools/ClipViewTool.d.ts +2 -2
- package/lib/cjs/tools/ClipViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ClipViewTool.js +6 -2
- package/lib/cjs/tools/ClipViewTool.js.map +1 -1
- package/lib/cjs/tools/MeasureTool.js +19 -24
- package/lib/cjs/tools/MeasureTool.js.map +1 -1
- package/lib/esm/AccuSnap.d.ts.map +1 -1
- package/lib/esm/AccuSnap.js +11 -25
- package/lib/esm/AccuSnap.js.map +1 -1
- package/lib/esm/ViewState.d.ts +36 -12
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +31 -24
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +5 -4
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.js +14 -11
- package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/esm/tile/TileDrawArgs.js +11 -17
- package/lib/esm/tile/TileDrawArgs.js.map +1 -1
- package/lib/esm/tools/ClipViewTool.d.ts +2 -2
- package/lib/esm/tools/ClipViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ClipViewTool.js +6 -2
- package/lib/esm/tools/ClipViewTool.js.map +1 -1
- package/lib/esm/tools/MeasureTool.js +19 -24
- package/lib/esm/tools/MeasureTool.js.map +1 -1
- package/package.json +20 -20
|
@@ -95,33 +95,28 @@ class MeasureMarker extends Marker_1.Marker {
|
|
|
95
95
|
}
|
|
96
96
|
/** @internal */
|
|
97
97
|
function adjustPoint(ev, segments, locations) {
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
var _a;
|
|
99
|
+
// If the point was from a hit we must transform it by the display transform of what got hit.
|
|
100
|
+
const hit = IModelApp_1.IModelApp.accuSnap.currHit;
|
|
101
|
+
if (!hit || !ev.viewport || !hit.modelId)
|
|
100
102
|
return ev.point;
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return seg.adjustedStart.clone();
|
|
113
|
-
if (seg.end.isExactEqual(ev.point))
|
|
114
|
-
return seg.adjustedEnd.clone();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
if (undefined !== locations) {
|
|
118
|
-
for (const loc of locations) {
|
|
119
|
-
if (loc.point.isExactEqual(ev.point))
|
|
120
|
-
return loc.adjustedPoint.clone();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
103
|
+
if ("0" !== hit.modelId) {
|
|
104
|
+
const transform = ev.viewport.view.computeDisplayTransform({ modelId: hit.modelId, elementId: hit.sourceId });
|
|
105
|
+
return (_a = transform === null || transform === void 0 ? void 0 : transform.multiplyInversePoint3d(ev.point)) !== null && _a !== void 0 ? _a : ev.point;
|
|
106
|
+
}
|
|
107
|
+
// Must have snapped to a decoration, so look through previous any segments & locations for a match to get an adjusted point.
|
|
108
|
+
if (segments) {
|
|
109
|
+
for (const seg of segments) {
|
|
110
|
+
if (seg.start.isExactEqual(ev.point))
|
|
111
|
+
return seg.adjustedStart.clone();
|
|
112
|
+
if (seg.end.isExactEqual(ev.point))
|
|
113
|
+
return seg.adjustedEnd.clone();
|
|
123
114
|
}
|
|
124
115
|
}
|
|
116
|
+
if (locations)
|
|
117
|
+
for (const loc of locations)
|
|
118
|
+
if (loc.point.isExactEqual(ev.point))
|
|
119
|
+
return loc.adjustedPoint.clone();
|
|
125
120
|
return ev.point;
|
|
126
121
|
}
|
|
127
122
|
/** Report distance between 2 points using current quantity formatter for length.
|