@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.
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
@@ -92,33 +92,28 @@ class MeasureMarker extends Marker {
92
92
  }
93
93
  /** @internal */
94
94
  function adjustPoint(ev, segments, locations) {
95
- // If the point was from a hit we must transform it by the model display transform of what got hit.
96
- if (undefined === ev.viewport || undefined === ev.viewport.view.modelDisplayTransformProvider)
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 (undefined !== IModelApp.accuSnap.currHit && undefined !== IModelApp.accuSnap.currHit.modelId) {
99
- if ("0" !== IModelApp.accuSnap.currHit.modelId) {
100
- const newPoint = ev.point.clone();
101
- ev.viewport.view.transformPointByModelDisplayTransform(IModelApp.accuSnap.currHit.modelId, newPoint, true);
102
- return newPoint;
103
- }
104
- else {
105
- // Must have snapped to a decoration, so look through previous any segments & locations for a match to get an adjusted point.
106
- if (undefined !== segments) {
107
- for (const seg of segments) {
108
- if (seg.start.isExactEqual(ev.point))
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.