Refactor interaction handling: change click events to double-click for DecalInstance, FloorInstance, and Wall components. Prevent event propagation to ensure proper selection behavior.

This commit is contained in:
2025-06-27 15:58:34 +05:30
parent edf76fa1c9
commit 12f1dd1771
3 changed files with 5 additions and 2 deletions

View File

@@ -59,11 +59,12 @@ function FloorInstance({ floor }: { floor: Floor }) {
receiveShadow
name={`Floor-${floor.floorUuid}`}
rotation={[Math.PI / 2, 0, 0]}
position={[0, !floor.isBeveled ? floor.floorDepth : (floor.floorDepth - 0.1), 0]}
position={[0, !floor.isBeveled ? (floor.floorDepth - 0.1) : (floor.floorDepth - 0.2), 0]}
userData={floor}
onDoubleClick={(e) => {
if (!togglView && activeModule === 'builder') {
if (e.object.userData.floorUuid) {
e.stopPropagation();
setSelectedFloor(e.object);
setSelectedDecal(null);
}