diff --git a/public/index.html b/public/index.html index 8af1fa7..e9ed13d 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,6 @@ -
Editor Demo
diff --git a/src/components/GizmoManager.tsx b/src/components/GizmoManager.tsx index d7bb11b..75dc071 100644 --- a/src/components/GizmoManager.tsx +++ b/src/components/GizmoManager.tsx @@ -91,14 +91,10 @@ export class GizmoManager { this.positionGizmo = new PositionGizmo(this.layer, thickness ?? 1); this.positionGizmo.scaleRatio = scale ?? 1; - //this.positionGizmo.onDragStartObservable.add(() => {setDragging(true)}); - //this.positionGizmo.onDragEndObservable.add(() => {setDragging(false)}) this.initPositionGizmo(); this.rotationGizmo = new RotationGizmo(this.layer, undefined, undefined, thickness ?? 1); this.rotationGizmo.scaleRatio = scale ?? 1; - //this.rotationGizmo.onDragStartObservable.add(() => {setDragging(true)}); - //this.rotationGizmo.onDragEndObservable.add(() => {setDragging(false)}) this.initRotationGizmo(); this.boundingBoxGizmo = new CustomBoundingBoxGizmo(setDragging, Color3.Gray(), this.layer, this); diff --git a/src/components/canvas.tsx b/src/components/canvas.tsx index ded4666..56bd20e 100644 --- a/src/components/canvas.tsx +++ b/src/components/canvas.tsx @@ -55,6 +55,7 @@ const CanvasRenderer: React.ForwardRefRenderFunction let isMoving = false; let wasMoving = false; + let gizmoScale = 0.7; React.useEffect(() => { @@ -160,7 +161,7 @@ const CanvasRenderer: React.ForwardRefRenderFunction } const setupGizmo = async () => { - gizmo.current = new GizmoManager(setDragging, setRootPos, scene.current, 3.5, 1); + gizmo.current = new GizmoManager(setDragging, setRootPos, scene.current, 4.5, gizmoScale); let inMultiselectMode = false; let pressedTimestamp = 0; const ray = new Ray(Vector3.Zero(), Vector3.Zero()) // necessary to ensure import of Ray @@ -257,20 +258,23 @@ const CanvasRenderer: React.ForwardRefRenderFunction } React.useImperativeHandle(env, () => handle); - const r = 15; + const rInner = 15 * gizmoScale; + const r = rInner + 6; const sectionAngle = 90/6; // todo: maybe also use z-index to represent axis overlap in correct order? return (
- - + + + + {Commands().undo(); setHiddenSelection(true), gizmo.current.removeAllNodes()}} icon="arrow-90deg-left"> -