@itwin/core-frontend 5.11.2 → 5.12.0-dev.10

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 (41) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/lib/cjs/AccuDraw.d.ts.map +1 -1
  3. package/lib/cjs/AccuDraw.js +3 -7
  4. package/lib/cjs/AccuDraw.js.map +1 -1
  5. package/lib/cjs/ViewState.d.ts.map +1 -1
  6. package/lib/cjs/ViewState.js +3 -4
  7. package/lib/cjs/ViewState.js.map +1 -1
  8. package/lib/cjs/Viewport.js +17 -17
  9. package/lib/cjs/Viewport.js.map +1 -1
  10. package/lib/cjs/tools/AccuDrawShortcutTool.d.ts.map +1 -1
  11. package/lib/cjs/tools/AccuDrawShortcutTool.js +6 -2
  12. package/lib/cjs/tools/AccuDrawShortcutTool.js.map +1 -1
  13. package/lib/cjs/tools/AccuDrawTool.d.ts +109 -23
  14. package/lib/cjs/tools/AccuDrawTool.d.ts.map +1 -1
  15. package/lib/cjs/tools/AccuDrawTool.js +234 -34
  16. package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
  17. package/lib/cjs/tools/ClipViewTool.d.ts +2 -1
  18. package/lib/cjs/tools/ClipViewTool.d.ts.map +1 -1
  19. package/lib/cjs/tools/ClipViewTool.js +8 -7
  20. package/lib/cjs/tools/ClipViewTool.js.map +1 -1
  21. package/lib/esm/AccuDraw.d.ts.map +1 -1
  22. package/lib/esm/AccuDraw.js +3 -7
  23. package/lib/esm/AccuDraw.js.map +1 -1
  24. package/lib/esm/ViewState.d.ts.map +1 -1
  25. package/lib/esm/ViewState.js +4 -5
  26. package/lib/esm/ViewState.js.map +1 -1
  27. package/lib/esm/Viewport.js +17 -17
  28. package/lib/esm/Viewport.js.map +1 -1
  29. package/lib/esm/tools/AccuDrawShortcutTool.d.ts.map +1 -1
  30. package/lib/esm/tools/AccuDrawShortcutTool.js +6 -2
  31. package/lib/esm/tools/AccuDrawShortcutTool.js.map +1 -1
  32. package/lib/esm/tools/AccuDrawTool.d.ts +109 -23
  33. package/lib/esm/tools/AccuDrawTool.d.ts.map +1 -1
  34. package/lib/esm/tools/AccuDrawTool.js +233 -34
  35. package/lib/esm/tools/AccuDrawTool.js.map +1 -1
  36. package/lib/esm/tools/ClipViewTool.d.ts +2 -1
  37. package/lib/esm/tools/ClipViewTool.d.ts.map +1 -1
  38. package/lib/esm/tools/ClipViewTool.js +9 -8
  39. package/lib/esm/tools/ClipViewTool.js.map +1 -1
  40. package/lib/public/locales/en/CoreTools.json +10 -0
  41. package/package.json +20 -20
@@ -14,7 +14,7 @@ import { LocateResponse } from "../ElementLocateManager";
14
14
  import { IModelApp } from "../IModelApp";
15
15
  import { EditManipulator } from "./EditManipulator";
16
16
  import { PrimitiveTool } from "./PrimitiveTool";
17
- import { BeButtonEvent, CoordinateLockOverrides, CoreTools, EventHandled } from "./Tool";
17
+ import { CoordinateLockOverrides, CoreTools, EventHandled } from "./Tool";
18
18
  import { ToolAssistance, ToolAssistanceImage, ToolAssistanceInputMethod } from "./ToolAssistance";
19
19
  import { GraphicType } from "../common/render/GraphicType";
20
20
  /** A tool to define a clip volume for a view
@@ -463,8 +463,8 @@ export class ViewClipByPlaneTool extends ViewClipTool {
463
463
  export class ViewClipByShapeTool extends ViewClipTool {
464
464
  static toolId = "ViewClip.ByShape";
465
465
  static iconSpec = "icon-section-shape";
466
- /** @internal */
467
466
  _orientationValue = { value: ContextRotationId.Top };
467
+ _lastMotion;
468
468
  /** @internal */
469
469
  _points = [];
470
470
  /** @internal */
@@ -598,9 +598,8 @@ export class ViewClipByShapeTool extends ViewClipTool {
598
598
  decorate(context) {
599
599
  if (context.viewport !== this.targetView)
600
600
  return;
601
- const ev = new BeButtonEvent();
602
- IModelApp.toolAdmin.fillEventFromCursorLocation(ev);
603
- if (undefined === ev.viewport)
601
+ const ev = this._lastMotion;
602
+ if (undefined === ev?.viewport)
604
603
  return;
605
604
  const points = this.getClipPoints(ev);
606
605
  if (points.length < 2)
@@ -621,6 +620,7 @@ export class ViewClipByShapeTool extends ViewClipTool {
621
620
  }
622
621
  /** @internal */
623
622
  async onMouseMotion(ev) {
623
+ this._lastMotion = ev;
624
624
  if (this._points.length > 0 && undefined !== ev.viewport)
625
625
  ev.viewport.invalidateDecorations();
626
626
  }
@@ -670,6 +670,7 @@ export class ViewClipByShapeTool extends ViewClipTool {
670
670
  export class ViewClipByRangeTool extends ViewClipTool {
671
671
  static toolId = "ViewClip.ByRange";
672
672
  static iconSpec = "icon-section-range";
673
+ _lastMotion;
673
674
  /** @internal */
674
675
  _corner;
675
676
  /** @internal */
@@ -712,9 +713,8 @@ export class ViewClipByRangeTool extends ViewClipTool {
712
713
  decorate(context) {
713
714
  if (context.viewport !== this.targetView || undefined === this._corner)
714
715
  return;
715
- const ev = new BeButtonEvent();
716
- IModelApp.toolAdmin.fillEventFromCursorLocation(ev);
717
- if (undefined === ev.viewport)
716
+ const ev = this._lastMotion;
717
+ if (undefined === ev?.viewport)
718
718
  return;
719
719
  const range = Range3d.create();
720
720
  const transform = Transform.createIdentity();
@@ -733,6 +733,7 @@ export class ViewClipByRangeTool extends ViewClipTool {
733
733
  }
734
734
  /** @internal */
735
735
  async onMouseMotion(ev) {
736
+ this._lastMotion = ev;
736
737
  if (undefined !== this._corner && undefined !== ev.viewport)
737
738
  ev.viewport.invalidateDecorations();
738
739
  }