@babylonjs/gui-editor 5.40.0 → 5.41.0

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.
@@ -38210,7 +38210,7 @@ class CommonControlPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_
38210
38210
  }
38211
38211
  };
38212
38212
  const fontStyleOptions = [
38213
- { label: "regular", value: "regular", id: "0" },
38213
+ { label: "normal", value: "normal", id: "0" },
38214
38214
  { label: "italic", value: "italic", id: "1" },
38215
38215
  { label: "oblique", value: "oblique", id: "2" },
38216
38216
  ];
@@ -41503,20 +41503,70 @@ __webpack_require__.r(__webpack_exports__);
41503
41503
  /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
41504
41504
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../../../node_modules/react/index.js");
41505
41505
  /* harmony import */ var _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gizmoScalePoint */ "../../../tools/guiEditor/dist/diagram/gizmoScalePoint.js");
41506
- /* harmony import */ var _coordinateHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./coordinateHelper */ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js");
41507
- /* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core/Maths/math */ "core/Misc/observable");
41508
- /* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math__WEBPACK_IMPORTED_MODULE_4__);
41506
+ /* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core/Maths/math */ "core/Misc/observable");
41507
+ /* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math__WEBPACK_IMPORTED_MODULE_3__);
41508
+ /* harmony import */ var _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./coordinateHelper */ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js");
41509
+ /* harmony import */ var gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gui/2D/math2D */ "gui/2D/controls/container");
41510
+ /* harmony import */ var gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__);
41511
+
41509
41512
 
41510
41513
 
41511
41514
 
41512
41515
 
41513
41516
 
41517
+ function getPivotToRef(x1, y1, x2, y2, centerX, centerY, ref) {
41518
+ const minX = Math.min(x1, x2);
41519
+ const minY = Math.min(y1, y2);
41520
+ const maxX = Math.max(x1, x2);
41521
+ const maxY = Math.max(y1, y2);
41522
+ const width = maxX - minX;
41523
+ const height = maxY - minY;
41524
+ // Get pivot
41525
+ const xm = minX + width * centerX;
41526
+ const ym = minY + height * centerY;
41527
+ ref.x = xm;
41528
+ ref.y = ym;
41529
+ }
41530
+ const TmpVectors = [new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(), new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(), new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2()];
41531
+ /**
41532
+ * This class represents the gizmo drawn on a line Control.
41533
+ */
41514
41534
  function GizmoLine(props) {
41515
41535
  const { control, globalState } = props;
41536
+ const isPivotMoving = react__WEBPACK_IMPORTED_MODULE_1__.useRef(false);
41537
+ const isDragging = react__WEBPACK_IMPORTED_MODULE_1__.useRef(false);
41538
+ const isRotating = react__WEBPACK_IMPORTED_MODULE_1__.useRef(false);
41539
+ const movedScalePoint = react__WEBPACK_IMPORTED_MODULE_1__.useRef();
41540
+ const lastCursor = react__WEBPACK_IMPORTED_MODULE_1__.useRef(new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2());
41541
+ const pivot = react__WEBPACK_IMPORTED_MODULE_1__.useRef(new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2());
41516
41542
  const [scalePoints, setScalePoints] = react__WEBPACK_IMPORTED_MODULE_1__.useState([
41517
- { position: new core_Maths_math__WEBPACK_IMPORTED_MODULE_4__.Vector2(), horizontalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Left, verticalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Center, rotation: 0, isPivot: false, defaultRotation: 0 },
41518
- { position: new core_Maths_math__WEBPACK_IMPORTED_MODULE_4__.Vector2(), horizontalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Center, verticalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Center, rotation: 0, isPivot: true, defaultRotation: 0 },
41519
- { position: new core_Maths_math__WEBPACK_IMPORTED_MODULE_4__.Vector2(), horizontalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Right, verticalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Center, rotation: 0, isPivot: false, defaultRotation: 0 },
41543
+ {
41544
+ position: new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(),
41545
+ horizontalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Left,
41546
+ verticalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Top,
41547
+ rotation: 0,
41548
+ isPivot: false,
41549
+ defaultRotation: 0,
41550
+ id: 0,
41551
+ },
41552
+ {
41553
+ position: new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(),
41554
+ horizontalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Center,
41555
+ verticalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Center,
41556
+ rotation: 0,
41557
+ isPivot: true,
41558
+ defaultRotation: 0,
41559
+ id: 1,
41560
+ },
41561
+ {
41562
+ position: new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(),
41563
+ horizontalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Right,
41564
+ verticalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Bottom,
41565
+ rotation: 0,
41566
+ isPivot: false,
41567
+ defaultRotation: 0,
41568
+ id: 2,
41569
+ },
41520
41570
  ]);
41521
41571
  react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
41522
41572
  // setup
@@ -41530,29 +41580,160 @@ function GizmoLine(props) {
41530
41580
  }, []);
41531
41581
  const update = () => {
41532
41582
  const line = control;
41533
- const offsetX = line._cachedParentMeasure.width * 0.5;
41534
- const offsetY = line._cachedParentMeasure.height * 0.5;
41535
- const x1 = line._x1.getValue(control.host) - offsetX;
41536
- const y1 = line._y1.getValue(control.host) - offsetY;
41537
- const x2 = line._effectiveX2 - offsetX;
41538
- const y2 = line._effectiveY2 - offsetY;
41539
- const positions = [
41540
- new core_Maths_math__WEBPACK_IMPORTED_MODULE_4__.Vector2(x1, y1),
41541
- new core_Maths_math__WEBPACK_IMPORTED_MODULE_4__.Vector2((control.transformCenterX - 0.5) * control.widthInPixels, (control.transformCenterY - 0.5) * control.heightInPixels),
41542
- new core_Maths_math__WEBPACK_IMPORTED_MODULE_4__.Vector2(x2, y2),
41543
- ];
41583
+ const x1 = line._cachedParentMeasure.left + line._x1.getValue(line._host);
41584
+ const y1 = line._cachedParentMeasure.top + line._y1.getValue(line._host);
41585
+ const x2 = line._cachedParentMeasure.left + line._effectiveX2;
41586
+ const y2 = line._cachedParentMeasure.top + line._effectiveY2;
41587
+ const v1 = TmpVectors[0].set(x1, y1);
41588
+ const v2 = TmpVectors[1].set(x2, y2);
41589
+ const vm = TmpVectors[2];
41590
+ getPivotToRef(x1, y1, x2, y2, line.transformCenterX, line.transformCenterY, vm);
41591
+ const matrix = line._transformMatrix;
41592
+ matrix.transformCoordinates(v1.x, v1.y, v1);
41593
+ matrix.transformCoordinates(v2.x, v2.y, v2);
41594
+ matrix.transformCoordinates(vm.x, vm.y, vm);
41595
+ pivot.current = vm;
41596
+ const positions = [v1, vm, v2];
41544
41597
  setScalePoints(scalePoints.map((point, index) => {
41545
41598
  const position = positions[index];
41546
- const rtt = _coordinateHelper__WEBPACK_IMPORTED_MODULE_3__.CoordinateHelper.NodeToRTTSpace(control, position.x, position.y);
41547
- const canvas = _coordinateHelper__WEBPACK_IMPORTED_MODULE_3__.CoordinateHelper.RttToCanvasSpace(rtt.x, rtt.y);
41548
41599
  return {
41549
41600
  ...point,
41550
- position: canvas,
41551
- rotation: control.rotation,
41601
+ position,
41602
+ rotation: line.rotation,
41552
41603
  };
41553
41604
  }));
41554
41605
  };
41555
- return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "gizmo", children: scalePoints.map((point, index) => ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.GizmoScalePoint, { scalePoint: point, clickable: true, onDrag: () => { }, onRotate: () => { }, onUp: () => { }, overrideCursor: "not-allowed", canRotate: false }, index))) }));
41606
+ const _getAddAndRound = (value, host, delta) => {
41607
+ return gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(value.getValue(host) + delta);
41608
+ };
41609
+ const _getDeltasToRef = (currentPointer, ref) => {
41610
+ // We have to compute the difference in movement in the local node
41611
+ // coordintes, so that it accounts for zoom
41612
+ const rttClientCoords = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.MousePointerToRTTSpace(control, currentPointer.x, currentPointer.y);
41613
+ const localClientCoords = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.RttToLocalNodeSpace(control, rttClientCoords.x, rttClientCoords.y);
41614
+ const rttLastCoordinates = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.MousePointerToRTTSpace(control, lastCursor.current.x, lastCursor.current.y);
41615
+ const localLastCoordinates = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.RttToLocalNodeSpace(control, rttLastCoordinates.x, rttLastCoordinates.y);
41616
+ const delta = TmpVectors[0];
41617
+ localClientCoords.subtractToRef(localLastCoordinates, delta);
41618
+ const rotatedDelta = TmpVectors[1];
41619
+ delta.rotateToRef(control.rotation, rotatedDelta);
41620
+ ref.x = rotatedDelta.x;
41621
+ ref.y = rotatedDelta.y;
41622
+ };
41623
+ const _dragPivot = (currentPointer) => {
41624
+ const deltas = TmpVectors[0];
41625
+ _getDeltasToRef(currentPointer, deltas);
41626
+ control.x1 = _getAddAndRound(control._x1, control._host, deltas.x);
41627
+ control.y1 = _getAddAndRound(control._y1, control._host, deltas.y);
41628
+ control.x2 = _getAddAndRound(control._x2, control._host, deltas.x);
41629
+ control.y2 = _getAddAndRound(control._y2, control._host, deltas.y);
41630
+ globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
41631
+ };
41632
+ const _dragEndpoint = (currentPointer) => {
41633
+ const deltas = TmpVectors[0];
41634
+ _getDeltasToRef(currentPointer, deltas);
41635
+ // Move only the scale point that was touched
41636
+ const movedPointIndex = movedScalePoint.current;
41637
+ if (movedPointIndex === 0) {
41638
+ // Moved first point, (x1, y1)
41639
+ control.x1 = _getAddAndRound(control._x1, control._host, deltas.x);
41640
+ control.y1 = _getAddAndRound(control._y1, control._host, deltas.y);
41641
+ }
41642
+ else if (movedPointIndex === 2) {
41643
+ // Moved second point, (x2, y2)
41644
+ control.x2 = _getAddAndRound(control._x2, control._host, deltas.x);
41645
+ control.y2 = _getAddAndRound(control._y2, control._host, deltas.y);
41646
+ }
41647
+ globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
41648
+ };
41649
+ const _rotateEndpoint = (currentPointer) => {
41650
+ const currentToPivot = currentPointer.subtract(pivot.current);
41651
+ currentToPivot.normalize();
41652
+ const lastToPivot = lastCursor.current.subtract(pivot.current);
41653
+ lastToPivot.normalize();
41654
+ const dotProd = core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2.Dot(currentToPivot, lastToPivot);
41655
+ const angle = Math.acos(dotProd);
41656
+ const direction = -Math.sign(currentToPivot.x * lastToPivot.y - currentToPivot.y * lastToPivot.x);
41657
+ if (!isNaN(angle)) {
41658
+ control.rotation += direction * angle;
41659
+ control.rotation = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(control.rotation);
41660
+ globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
41661
+ }
41662
+ };
41663
+ const onMove = () => {
41664
+ const scene = globalState.workbench._scene;
41665
+ const currentPointer = new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(scene.pointerX, scene.pointerY);
41666
+ if (isDragging.current && isPivotMoving.current) {
41667
+ _dragPivot(currentPointer);
41668
+ }
41669
+ else if (isDragging.current) {
41670
+ _dragEndpoint(currentPointer);
41671
+ }
41672
+ else if (isRotating.current) {
41673
+ _rotateEndpoint(currentPointer);
41674
+ }
41675
+ lastCursor.current = currentPointer;
41676
+ };
41677
+ const onUp = () => {
41678
+ isDragging.current = false;
41679
+ isRotating.current = false;
41680
+ };
41681
+ react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
41682
+ const pointerMoveObserver = props.globalState.onPointerMoveObservable.add(onMove);
41683
+ const pointerUpObserver = props.globalState.onPointerUpObservable.add(onUp);
41684
+ return () => {
41685
+ props.globalState.onPointerMoveObservable.remove(pointerMoveObserver);
41686
+ props.globalState.onPointerUpObservable.remove(pointerUpObserver);
41687
+ };
41688
+ }, []);
41689
+ const onDrag = (event, scalePoint) => {
41690
+ if (event && scalePoint) {
41691
+ const scene = globalState.workbench._scene;
41692
+ lastCursor.current = new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(scene.pointerX, scene.pointerY);
41693
+ isPivotMoving.current = scalePoint.isPivot;
41694
+ // If the control has any rotation, reset the
41695
+ // rotation, modifying the so the scale behave as expected
41696
+ if (!scalePoint.isPivot && control.rotation) {
41697
+ const line = control;
41698
+ const x1 = line._x1.getValue(line._host);
41699
+ const y1 = line._y1.getValue(line._host);
41700
+ const x2 = line._x2.getValue(line._host);
41701
+ const y2 = line._y2.getValue(line._host);
41702
+ const v1 = TmpVectors[0].set(x1, y1);
41703
+ const v2 = TmpVectors[1].set(x2, y2);
41704
+ const vm = TmpVectors[2];
41705
+ getPivotToRef(x1, y1, x2, y2, line.transformCenterX, line.transformCenterY, vm);
41706
+ const finalTransform = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.Identity();
41707
+ const currentTransform = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.Identity();
41708
+ gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.TranslationToRef(-vm.x, -vm.y, currentTransform);
41709
+ finalTransform.multiplyToRef(currentTransform, finalTransform);
41710
+ gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.RotationToRef(control.rotation, currentTransform);
41711
+ finalTransform.multiplyToRef(currentTransform, finalTransform);
41712
+ gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.TranslationToRef(vm.x, vm.y, currentTransform);
41713
+ finalTransform.multiplyToRef(currentTransform, finalTransform);
41714
+ finalTransform.transformCoordinates(v1.x, v1.y, v1);
41715
+ finalTransform.transformCoordinates(v2.x, v2.y, v2);
41716
+ control.rotation = 0;
41717
+ control.x1 = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(v1.x);
41718
+ control.y1 = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(v1.y);
41719
+ control.x2 = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(v2.x);
41720
+ control.y2 = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(v2.y);
41721
+ globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
41722
+ }
41723
+ isDragging.current = true;
41724
+ isRotating.current = false;
41725
+ movedScalePoint.current = scalePoint.id;
41726
+ }
41727
+ };
41728
+ const onRotate = (event) => {
41729
+ if (event) {
41730
+ isRotating.current = true;
41731
+ isDragging.current = false;
41732
+ const scene = globalState.workbench._scene;
41733
+ lastCursor.current = new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(scene.pointerX, scene.pointerY);
41734
+ }
41735
+ };
41736
+ return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "gizmo", children: scalePoints.map((point, index) => ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.GizmoScalePoint, { scalePoint: point, allowClickOnPivot: true, clickable: true, onDrag: onDrag, onRotate: onRotate, onUp: onUp, canRotate: true }, index))) }));
41556
41737
  }
41557
41738
 
41558
41739
 
@@ -41626,7 +41807,7 @@ const scalePointCursors = [
41626
41807
  const rotateCursors = [_imgs_cursor_rotate0_svg__WEBPACK_IMPORTED_MODULE_6__, _imgs_cursor_rotate1_svg__WEBPACK_IMPORTED_MODULE_7__, _imgs_cursor_rotate2_svg__WEBPACK_IMPORTED_MODULE_8__, _imgs_cursor_rotate3_svg__WEBPACK_IMPORTED_MODULE_9__, _imgs_cursor_rotate4_svg__WEBPACK_IMPORTED_MODULE_10__, _imgs_cursor_rotate5_svg__WEBPACK_IMPORTED_MODULE_11__, _imgs_cursor_rotate6_svg__WEBPACK_IMPORTED_MODULE_12__, _imgs_cursor_rotate7_svg__WEBPACK_IMPORTED_MODULE_13__].map((cursor) => `url("${cursor}") 12 12, pointer`);
41627
41808
  const modulo = (dividend, divisor) => ((dividend % divisor) + divisor) % divisor;
41628
41809
  function GizmoScalePoint(props) {
41629
- const { scalePoint, clickable, onDrag, onRotate, onUp, overrideCursor, canRotate } = props;
41810
+ const { scalePoint, clickable, onDrag, onRotate, onUp, overrideCursor, canRotate, allowClickOnPivot } = props;
41630
41811
  const style = {
41631
41812
  left: `${scalePoint.position.x}px`,
41632
41813
  top: `${scalePoint.position.y}px`,
@@ -41634,7 +41815,15 @@ function GizmoScalePoint(props) {
41634
41815
  pointerEvents: clickable ? "auto" : "none",
41635
41816
  };
41636
41817
  if (scalePoint.isPivot) {
41637
- return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "pivot-point", src: _imgs_gizmoPivotIcon_svg__WEBPACK_IMPORTED_MODULE_1__, style: style, onDragStart: (evt) => evt.preventDefault() });
41818
+ return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "pivot-point", src: _imgs_gizmoPivotIcon_svg__WEBPACK_IMPORTED_MODULE_1__, style: style, onDragStart: (evt) => evt.preventDefault(), onPointerDown: (event) => {
41819
+ if (allowClickOnPivot) {
41820
+ onDrag(event, scalePoint);
41821
+ }
41822
+ }, onPointerUp: () => {
41823
+ if (allowClickOnPivot) {
41824
+ onUp();
41825
+ }
41826
+ } }));
41638
41827
  }
41639
41828
  // compute which cursor icon to use on hover
41640
41829
  const angleOfCursor = scalePoint.defaultRotation + scalePoint.rotation;
@@ -41657,14 +41846,16 @@ function GizmoScalePoint(props) {
41657
41846
  left: (scalePointContainerSize - scaleClickAreaSize) / 2 - scaleClickAreaOffset * scalePoint.horizontalPosition,
41658
41847
  cursor,
41659
41848
  };
41660
- return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { style: style, className: "scale-point-container", children: [canRotate && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rotate-click-area", onPointerDown: onRotate, style: rotateClickAreaStyle }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "scale-click-area", draggable: true, onDragStart: (evt) => evt.preventDefault(), onPointerDown: (event) => {
41849
+ return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { style: style, className: "scale-point-container", children: [canRotate && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rotate-click-area", onPointerDown: (event) => {
41850
+ onRotate(event, scalePoint);
41851
+ }, style: rotateClickAreaStyle })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "scale-click-area", draggable: true, onDragStart: (evt) => evt.preventDefault(), onPointerDown: (event) => {
41661
41852
  // if left mouse button down
41662
41853
  if (event.buttons & 1) {
41663
- onDrag();
41854
+ onDrag(event, scalePoint);
41664
41855
  }
41665
41856
  }, onPointerUp: onUp, style: scaleClickAreaStyle }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "scale-point", draggable: true, onDragStart: (evt) => evt.preventDefault(), onPointerDown: (event) => {
41666
41857
  if (event.buttons & 1) {
41667
- onDrag();
41858
+ onDrag(event, scalePoint);
41668
41859
  }
41669
41860
  }, onPointerUp: onUp, style: { cursor } })] }));
41670
41861
  }