diff --git a/src/App.tsx b/src/App.tsx index 27cc3d0b6..d25ba8382 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -248,7 +248,7 @@ export function App() { {showDebugPanel && ( ['cmd'], - { type: 'default_camera_enable_sketch_mode' } -> export const DebugPanel = ({ className, ...props }: CollapsiblePanelProps) => { - const [sketchModeCmd, setSketchModeCmd] = useState({ - type: 'default_camera_enable_sketch_mode', - origin: { x: 0, y: 0, z: 0 }, - x_axis: { x: 1, y: 0, z: 0 }, - y_axis: { x: 0, y: 1, z: 0 }, - distance_to_plane: 100, - ortho: true, - animated: !isReducedMotion(), - }) - if (!sketchModeCmd) return null return ( { style={{ maxHeight: 'calc(100% - 3rem - 1.25rem - 1.25rem)' }} > - - - - - distance_to_plane - { - setSketchModeCmd({ - ...sketchModeCmd, - distance_to_plane: Number(target.value), - }) - }} - /> - ortho - - setSketchModeCmd({ - ...sketchModeCmd, - ortho: a.target.checked, - }) - } - /> - - { - engineCommandManager.sendSceneCommand({ - type: 'modeling_cmd_req', - cmd: sketchModeCmd, - cmd_id: uuidv4(), - }) - }} - className="hover:border-succeed-50" - icon={{ - icon: faCheck, - bgClassName: - 'bg-succeed-80 group-hover:bg-succeed-70 hover:bg-succeed-70', - iconClassName: - 'text-succeed-20 group-hover:text-succeed-10 hover:text-succeed-10', - }} - > - Send sketch mode command - @@ -102,41 +19,3 @@ export const DebugPanel = ({ className, ...props }: CollapsiblePanelProps) => { ) } - -const Xyz = ({ - pointKey, - data, - onChange, -}: { - pointKey: 'origin' | 'y_axis' | 'x_axis' - data: SketchModeCmd - onChange: (a: SketchModeCmd) => void -}) => { - if (!data) return null - return ( - - {pointKey} - {Object.entries(data[pointKey]).map(([axis, val]) => { - return ( - - {axis} - { - onChange({ - ...data, - [pointKey]: { - ...data[pointKey], - [axis]: Number(target.value), - }, - }) - }} - /> - - ) - })} - - ) -}