()
| 3 | import type { SelectionNode } from '../types'; |
| 4 | |
| 5 | export function useSelectionNode(): SelectionNode { |
| 6 | const showSelectionHighlight = useCameraStore((s) => s.showSelectionHighlight); |
| 7 | const selectionColorMode = useCameraStore((s) => s.selectionColorMode); |
| 8 | const selectionColor = useCameraStore((s) => s.selectionColor); |
| 9 | const selectionAnimationSpeed = useCameraStore((s) => s.selectionAnimationSpeed); |
| 10 | const selectionPlaneOpacity = useCameraStore((s) => s.selectionPlaneOpacity); |
| 11 | const unselectedCameraOpacity = useCameraStore((s) => s.unselectedCameraOpacity); |
| 12 | const selectedImageId = useCameraStore((s) => s.selectedImageId); |
| 13 | |
| 14 | return useMemo<SelectionNode>( |
| 15 | () => ({ |
| 16 | nodeType: 'selection', |
| 17 | visible: showSelectionHighlight, |
| 18 | colorMode: selectionColorMode, |
| 19 | color: selectionColor, |
| 20 | animationSpeed: selectionAnimationSpeed, |
| 21 | planeOpacity: selectionPlaneOpacity, |
| 22 | unselectedOpacity: unselectedCameraOpacity, |
| 23 | selectedImageId, |
| 24 | }), |
| 25 | [ |
| 26 | showSelectionHighlight, |
| 27 | selectionColorMode, |
| 28 | selectionColor, |
| 29 | selectionAnimationSpeed, |
| 30 | selectionPlaneOpacity, |
| 31 | unselectedCameraOpacity, |
| 32 | selectedImageId, |
| 33 | ] |
| 34 | ); |
| 35 | } |
no outgoing calls
no test coverage detected