@babylonjs/gui-editor 5.0.0-beta.1 → 5.0.0-beta.5

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.
@@ -800,17 +800,49 @@ declare module "@babylonjs/gui-editor/diagram/guiGizmo" {
800
800
  export interface IGuiGizmoProps {
801
801
  globalState: GlobalState;
802
802
  }
803
- export class GuiGizmoComponent extends React.Component<IGuiGizmoProps> {
804
- scalePoints: HTMLDivElement[];
805
- private _scalePointIndex;
806
- private _pointerData;
807
- private _htmlPoints;
803
+ enum ScalePointPosition {
804
+ Top = -1,
805
+ Left = -1,
806
+ Center = 0,
807
+ Right = 1,
808
+ Bottom = 1
809
+ }
810
+ interface IScalePoint {
811
+ position: Vector2;
812
+ horizontalPosition: ScalePointPosition;
813
+ verticalPosition: ScalePointPosition;
814
+ rotation: number;
815
+ isPivot: boolean;
816
+ }
817
+ class Rect {
818
+ top: number;
819
+ left: number;
820
+ right: number;
821
+ bottom: number;
822
+ constructor(left: number, top: number, right: number, bottom: number);
823
+ get center(): Vector2;
824
+ get width(): number;
825
+ get height(): number;
826
+ }
827
+ interface IGuiGizmoState {
828
+ canvasBounds: Rect;
829
+ scalePoints: IScalePoint[];
830
+ scalePointDragging: number;
831
+ isRotating: boolean;
832
+ }
833
+ export class GuiGizmoComponent extends React.Component<IGuiGizmoProps, IGuiGizmoState> {
808
834
  private _matrixCache;
809
835
  private _responsive;
836
+ private _initH;
837
+ private _initW;
838
+ private _initX;
839
+ private _initY;
840
+ private _localBounds;
841
+ private _rotation;
810
842
  constructor(props: IGuiGizmoProps);
811
843
  componentDidMount(): void;
812
844
  /**
813
- * Update the gizmo's corners positions
845
+ * Update the gizmo's positions
814
846
  * @param force should the update be forced. otherwise it will be updated only when the pointer is down
815
847
  */
816
848
  updateGizmo(force?: boolean): void;
@@ -843,29 +875,17 @@ declare module "@babylonjs/gui-editor/diagram/guiGizmo" {
843
875
  */
844
876
  getScale(node: Control, relative?: boolean): Vector2;
845
877
  getRotation(node: Control, relative?: boolean): number;
846
- createBaseGizmo(): void;
847
878
  onUp(evt?: React.PointerEvent): void;
848
879
  private _onUp;
849
880
  onMove(evt: React.PointerEvent): void;
850
- private _initH;
851
- private _initW;
852
- private _initX;
853
- private _initY;
854
881
  private _onMove;
855
- /**
856
- * Calculate the 4 corners in node space
857
- * @param node The node to use
858
- */
859
- private _nodeToCorners;
860
- /**
861
- * Computer the node's width, height, top and left, using the 4 corners
862
- * @param node the node we use
863
- */
864
- private _updateNodeFromCorners;
865
882
  private _rotate;
866
- private _setNodeCorner;
867
- private _setMousePosition;
868
- render(): null;
883
+ private _computeLocalBounds;
884
+ private _dragLocalBounds;
885
+ private _updateNodeFromLocalBounds;
886
+ private _beginDraggingScalePoint;
887
+ private _beginRotate;
888
+ render(): JSX.Element | null;
869
889
  }
870
890
  }
871
891
  declare module "@babylonjs/gui-editor/globalState" {
package/package.json CHANGED
@@ -4,14 +4,14 @@
4
4
  },
5
5
  "name": "@babylonjs/gui-editor",
6
6
  "description": "The Babylon.js GUI editor.",
7
- "version": "5.0.0-beta.1",
7
+ "version": "5.0.0-beta.5",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/BabylonJS/Babylon.js.git"
11
11
  },
12
12
  "license": "Apache-2.0",
13
13
  "dependencies": {
14
- "@babylonjs/core": "5.0.0-beta.1",
14
+ "@babylonjs/core": "5.0.0-beta.5",
15
15
  "tslib": "^2.3.1"
16
16
  },
17
17
  "files": [