diff --git a/app/src/modules/builder/geomentries/lines/updateDistanceText.ts b/app/src/modules/builder/geomentries/lines/updateDistanceText.ts index 8a5a1cc..8d7fbe2 100644 --- a/app/src/modules/builder/geomentries/lines/updateDistanceText.ts +++ b/app/src/modules/builder/geomentries/lines/updateDistanceText.ts @@ -10,7 +10,7 @@ function updateDistanceText( ////////// Updating the Distance Texts of the lines that are affected during drag ////////// - const DistanceGroup = scene.children.find((child) => child.name === "Distance_Text") as THREE.Group; + const DistanceGroup = scene.getObjectByName('Distance_Text') as THREE.Group; affectedLines.forEach((lineIndex) => { const mesh = floorPlanGroupLine.current.children[lineIndex] as THREE.Mesh; diff --git a/app/src/modules/collaboration/comments/instances/commentInstance/commentInstance.tsx b/app/src/modules/collaboration/comments/instances/commentInstance/commentInstance.tsx index 5b5c145..1efff39 100644 --- a/app/src/modules/collaboration/comments/instances/commentInstance/commentInstance.tsx +++ b/app/src/modules/collaboration/comments/instances/commentInstance/commentInstance.tsx @@ -10,7 +10,6 @@ function CommentInstance({ comment }: { comment: CommentSchema }) { const [selectedComment, setSelectedComment] = useState(null); const [transformMode, setTransformMode] = useState<"translate" | "rotate" | null>(null); - useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { const keyCombination = detectModifierKeys(e); @@ -22,13 +21,13 @@ function CommentInstance({ comment }: { comment: CommentSchema }) { setTransformMode((prev) => (prev === "rotate" ? null : "rotate")); } }; - + window.addEventListener("keydown", handleKeyDown); return () => window.removeEventListener("keydown", handleKeyDown); }, [selectedComment]); - + if (comment.state === 'inactive' || isPlaying) return null; - + return ( <> @@ -37,26 +36,12 @@ function CommentInstance({ comment }: { comment: CommentSchema }) { zIndexRange={[1, 0]} prepend sprite - center + center position={comment.position} rotation={comment.rotation} className='comments-main-wrapper' > - {/*
{ - e.stopPropagation(); - setSelectedComment(comment); - console.log("down"); - }} - onPointerOver={(e) => { - e.stopPropagation(); - }}> -
- hii -
-
*/} {CommentRef.current && transformMode && ( { sprite >
- {startConePosition.distanceTo(endConePosition).toFixed(2)} m + {(startConePosition.distanceTo(endConePosition) + (coneSize.height)).toFixed(2)} m
)}