diff --git a/app/src/modules/builder/Decal/decalCreator/decalCreator.tsx b/app/src/modules/builder/Decal/decalCreator/decalCreator.tsx index 221a2bf..35b54ce 100644 --- a/app/src/modules/builder/Decal/decalCreator/decalCreator.tsx +++ b/app/src/modules/builder/Decal/decalCreator/decalCreator.tsx @@ -15,7 +15,7 @@ import { getUserData } from '../../../../functions/getUserData'; function DecalCreator() { const { wallStore, floorStore } = useSceneContext(); const { addDecal: addDecalOnWall, getWallById } = wallStore(); - const { addDecal : addDecalOnFloor, getFloorById } = floorStore(); + const { addDecal: addDecalOnFloor, getFloorById } = floorStore(); const { droppedDecal } = useDroppedDecal(); const { activeModule } = useModuleStore(); const { userId, organization } = getUserData(); @@ -36,6 +36,7 @@ function DecalCreator() { const intersects = raycaster.intersectObjects(scene.children, true); const wallIntersect = intersects.find(i => i.object.userData && i.object.userData.wallUuid); const floorIntersect = intersects.find(i => i.object.userData && i.object.userData.floorUuid); + console.log('wallIntersect: ', wallIntersect); if (wallIntersect) { const wall = getWallById(wallIntersect.object.userData.wallUuid); @@ -51,7 +52,7 @@ function DecalCreator() { type: 'Wall', wallUuid: wallIntersect.object.userData.wallUuid, }, - decalPosition: [point.x, point.y, wall.wallThickness / 2 + 0.001], + decalPosition: [point.x, point.y, (wall.wallThickness / 2 + 0.001) * (wallIntersect.normal?.z || 1)], decalRotation: 0, decalOpacity: 1, decalScale: 1,