@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.
Files changed (45) hide show
  1. package/lib/cjs/AccuSnap.d.ts.map +1 -1
  2. package/lib/cjs/AccuSnap.js +10 -24
  3. package/lib/cjs/AccuSnap.js.map +1 -1
  4. package/lib/cjs/ViewState.d.ts +36 -12
  5. package/lib/cjs/ViewState.d.ts.map +1 -1
  6. package/lib/cjs/ViewState.js +31 -24
  7. package/lib/cjs/ViewState.js.map +1 -1
  8. package/lib/cjs/Viewport.d.ts.map +1 -1
  9. package/lib/cjs/Viewport.js +5 -4
  10. package/lib/cjs/Viewport.js.map +1 -1
  11. package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
  12. package/lib/cjs/tile/PrimaryTileTree.js +14 -11
  13. package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
  14. package/lib/cjs/tile/TileDrawArgs.d.ts.map +1 -1
  15. package/lib/cjs/tile/TileDrawArgs.js +10 -16
  16. package/lib/cjs/tile/TileDrawArgs.js.map +1 -1
  17. package/lib/cjs/tools/ClipViewTool.d.ts +2 -2
  18. package/lib/cjs/tools/ClipViewTool.d.ts.map +1 -1
  19. package/lib/cjs/tools/ClipViewTool.js +6 -2
  20. package/lib/cjs/tools/ClipViewTool.js.map +1 -1
  21. package/lib/cjs/tools/MeasureTool.js +19 -24
  22. package/lib/cjs/tools/MeasureTool.js.map +1 -1
  23. package/lib/esm/AccuSnap.d.ts.map +1 -1
  24. package/lib/esm/AccuSnap.js +11 -25
  25. package/lib/esm/AccuSnap.js.map +1 -1
  26. package/lib/esm/ViewState.d.ts +36 -12
  27. package/lib/esm/ViewState.d.ts.map +1 -1
  28. package/lib/esm/ViewState.js +31 -24
  29. package/lib/esm/ViewState.js.map +1 -1
  30. package/lib/esm/Viewport.d.ts.map +1 -1
  31. package/lib/esm/Viewport.js +5 -4
  32. package/lib/esm/Viewport.js.map +1 -1
  33. package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
  34. package/lib/esm/tile/PrimaryTileTree.js +14 -11
  35. package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
  36. package/lib/esm/tile/TileDrawArgs.d.ts.map +1 -1
  37. package/lib/esm/tile/TileDrawArgs.js +11 -17
  38. package/lib/esm/tile/TileDrawArgs.js.map +1 -1
  39. package/lib/esm/tools/ClipViewTool.d.ts +2 -2
  40. package/lib/esm/tools/ClipViewTool.d.ts.map +1 -1
  41. package/lib/esm/tools/ClipViewTool.js +6 -2
  42. package/lib/esm/tools/ClipViewTool.js.map +1 -1
  43. package/lib/esm/tools/MeasureTool.js +19 -24
  44. package/lib/esm/tools/MeasureTool.js.map +1 -1
  45. 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
- // If the point was from a hit we must transform it by the model display transform of what got hit.
99
- if (undefined === ev.viewport || undefined === ev.viewport.view.modelDisplayTransformProvider)
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 (undefined !== IModelApp_1.IModelApp.accuSnap.currHit && undefined !== IModelApp_1.IModelApp.accuSnap.currHit.modelId) {
102
- if ("0" !== IModelApp_1.IModelApp.accuSnap.currHit.modelId) {
103
- const newPoint = ev.point.clone();
104
- ev.viewport.view.transformPointByModelDisplayTransform(IModelApp_1.IModelApp.accuSnap.currHit.modelId, newPoint, true);
105
- return newPoint;
106
- }
107
- else {
108
- // Must have snapped to a decoration, so look through previous any segments & locations for a match to get an adjusted point.
109
- if (undefined !== segments) {
110
- for (const seg of segments) {
111
- if (seg.start.isExactEqual(ev.point))
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.