diff --git a/app/src/modules/builder/floor/Instances/Instance/floor2DInstance.tsx b/app/src/modules/builder/floor/Instances/Instance/floor2DInstance.tsx index 8ee1743..be96f78 100644 --- a/app/src/modules/builder/floor/Instances/Instance/floor2DInstance.tsx +++ b/app/src/modules/builder/floor/Instances/Instance/floor2DInstance.tsx @@ -17,16 +17,16 @@ function Floor2DInstance({ floor }: { readonly floor: Floor }) { const centroid: [number, number, number] = useMemo(() => { const center = getCenteroidPoint(points2D); - if (!center) return [0, Constants.floorConfig.height + 0.01, 0]; + if (!center) return [0, Constants.floorConfig.height, 0]; - return [center.x, Constants.floorConfig.height + 0.01, center.y] as [number, number, number]; + return [center.x, Constants.floorConfig.height, center.y] as [number, number, number]; }, [points2D]); const formattedArea = `${area.toFixed(2)} m²`; return ( <> - + diff --git a/app/src/modules/builder/wall/Instances/wallInstances.tsx b/app/src/modules/builder/wall/Instances/wallInstances.tsx index f64d23b..e2cf4d7 100644 --- a/app/src/modules/builder/wall/Instances/wallInstances.tsx +++ b/app/src/modules/builder/wall/Instances/wallInstances.tsx @@ -154,16 +154,16 @@ function Floor2D({ room }: { readonly room: Point[] }) { const centroid: [number, number, number] = useMemo(() => { const center = getCenteroidPoint(points2D); - if (!center) return [0, Constants.floorConfig.height + 0.01, 0]; + if (!center) return [0, Constants.floorConfig.height, 0]; - return [center.x, Constants.floorConfig.height + 0.01, center.y] as [number, number, number]; + return [center.x, Constants.floorConfig.height, center.y] as [number, number, number]; }, [points2D]); const formattedArea = `${area.toFixed(2)} m²`; return ( <> - + diff --git a/app/src/modules/builder/zone/Instances/Instance/zone2DInstance.tsx b/app/src/modules/builder/zone/Instances/Instance/zone2DInstance.tsx index 0b6cb76..d05da3c 100644 --- a/app/src/modules/builder/zone/Instances/Instance/zone2DInstance.tsx +++ b/app/src/modules/builder/zone/Instances/Instance/zone2DInstance.tsx @@ -17,16 +17,16 @@ function Zone2DInstance({ zone }: { readonly zone: Zone }) { const centroid: [number, number, number] = useMemo(() => { const center = getCenteroid(points2D); - if (!center) return [0, Constants.floorConfig.height + 0.01, 0]; + if (!center) return [0, Constants.floorConfig.height, 0]; - return [center.x, Constants.floorConfig.height + 0.01, center.y] as [number, number, number]; + return [center.x, Constants.floorConfig.height, center.y] as [number, number, number]; }, [points2D]); const formattedArea = `${area.toFixed(2)} m²`; return ( <> - + diff --git a/app/src/utils/shortcutkeys/detectModifierKeys.ts b/app/src/utils/shortcutkeys/detectModifierKeys.ts index 828245d..67e5e0b 100644 --- a/app/src/utils/shortcutkeys/detectModifierKeys.ts +++ b/app/src/utils/shortcutkeys/detectModifierKeys.ts @@ -1,35 +1,35 @@ // Function to detect if Shift, Ctrl, Alt, or combinations are pressed // and return the corresponding key combination string export const detectModifierKeys = (event: KeyboardEvent): string => { - const modifiers = [ - event.ctrlKey ? "Ctrl" : "", - event.altKey ? "Alt" : "", - event.shiftKey ? "Shift" : "", - event.metaKey ? "Meta" : "", // Add support for Command/Win key - ].filter(Boolean); + const modifiers = [ + event.ctrlKey ? "Ctrl" : "", + event.altKey ? "Alt" : "", + event.shiftKey ? "Shift" : "", + event.metaKey ? "Meta" : "", // Add support for Command/Win key + ].filter(Boolean); - // Ignore modifier keys when they're pressed alone - const isModifierKey = [ - "Control", - "Shift", - "Alt", - "Meta", - "Ctrl", - "AltGraph", - "OS", // Additional modifier key aliases - ].includes(event.key); + // Ignore modifier keys when they're pressed alone + const isModifierKey = [ + "Control", + "Shift", + "Alt", + "Meta", + "Ctrl", + "AltGraph", + "OS", // Additional modifier key aliases + ].includes(event.key); - const mainKey = isModifierKey ? "" : event.key.toUpperCase(); + const mainKey = isModifierKey ? "" : event.key.toUpperCase(); - // Handle special cases for keys with different representations - const normalizedKey = mainKey === " " ? "Space" : mainKey; + // Handle special cases for keys with different representations + const normalizedKey = mainKey === " " ? "Space" : mainKey; - // Build the combination string - if (modifiers.length > 0 && normalizedKey) { - return `${modifiers.join("+")}+${normalizedKey}`; - } else if (modifiers.length > 0) { - return modifiers.join("+"); - } else { - return normalizedKey; - } + // Build the combination string + if (modifiers.length > 0 && normalizedKey) { + return `${modifiers.join("+")}+${normalizedKey}`; + } else if (modifiers.length > 0) { + return modifiers.join("+"); + } else { + return normalizedKey; + } }; diff --git a/app/src/utils/shortcutkeys/handleShortcutKeys.ts b/app/src/utils/shortcutkeys/handleShortcutKeys.ts index ce7373e..701c41b 100644 --- a/app/src/utils/shortcutkeys/handleShortcutKeys.ts +++ b/app/src/utils/shortcutkeys/handleShortcutKeys.ts @@ -96,13 +96,13 @@ const KeyPressListener: React.FC = () => { // These should only apply in 2D view const twoDToolConfigs: Record = { Q: { tool: "draw-wall", mode: "Wall" }, - "6": { tool: "draw-wall", mode: "Wall" }, + // "6": { tool: "draw-wall", mode: "Wall" }, R: { tool: "draw-aisle", mode: "Aisle" }, - "7": { tool: "draw-aisle", mode: "Aisle" }, + // "7": { tool: "draw-aisle", mode: "Aisle" }, E: { tool: "draw-zone", mode: "Zone" }, - "8": { tool: "draw-zone", mode: "Zone" }, + // "8": { tool: "draw-zone", mode: "Zone" }, T: { tool: "draw-floor", mode: "Floor" }, - "9": { tool: "draw-floor", mode: "Floor" }, + // "9": { tool: "draw-floor", mode: "Floor" }, }; const config = twoDToolConfigs[key];