@itwin/core-frontend 3.4.0-dev.33 → 3.4.0-dev.36
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
|
@@ -92,33 +92,28 @@ class MeasureMarker extends Marker {
|
|
|
92
92
|
}
|
|
93
93
|
/** @internal */
|
|
94
94
|
function adjustPoint(ev, segments, locations) {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
var _a;
|
|
96
|
+
// If the point was from a hit we must transform it by the display transform of what got hit.
|
|
97
|
+
const hit = IModelApp.accuSnap.currHit;
|
|
98
|
+
if (!hit || !ev.viewport || !hit.modelId)
|
|
97
99
|
return ev.point;
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return seg.adjustedStart.clone();
|
|
110
|
-
if (seg.end.isExactEqual(ev.point))
|
|
111
|
-
return seg.adjustedEnd.clone();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (undefined !== locations) {
|
|
115
|
-
for (const loc of locations) {
|
|
116
|
-
if (loc.point.isExactEqual(ev.point))
|
|
117
|
-
return loc.adjustedPoint.clone();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
100
|
+
if ("0" !== hit.modelId) {
|
|
101
|
+
const transform = ev.viewport.view.computeDisplayTransform({ modelId: hit.modelId, elementId: hit.sourceId });
|
|
102
|
+
return (_a = transform === null || transform === void 0 ? void 0 : transform.multiplyInversePoint3d(ev.point)) !== null && _a !== void 0 ? _a : ev.point;
|
|
103
|
+
}
|
|
104
|
+
// Must have snapped to a decoration, so look through previous any segments & locations for a match to get an adjusted point.
|
|
105
|
+
if (segments) {
|
|
106
|
+
for (const seg of segments) {
|
|
107
|
+
if (seg.start.isExactEqual(ev.point))
|
|
108
|
+
return seg.adjustedStart.clone();
|
|
109
|
+
if (seg.end.isExactEqual(ev.point))
|
|
110
|
+
return seg.adjustedEnd.clone();
|
|
120
111
|
}
|
|
121
112
|
}
|
|
113
|
+
if (locations)
|
|
114
|
+
for (const loc of locations)
|
|
115
|
+
if (loc.point.isExactEqual(ev.point))
|
|
116
|
+
return loc.adjustedPoint.clone();
|
|
122
117
|
return ev.point;
|
|
123
118
|
}
|
|
124
119
|
/** Report distance between 2 points using current quantity formatter for length.
|