diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/SceneProps/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/SceneProps/index.tsx index f2e4349ea..11d834c2d 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/SceneProps/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/SceneProps/index.tsx @@ -266,7 +266,7 @@ export function SceneProps() { return () => { dissectEvent.off(handleDissectEvent); }; - }, []); + }, [display]); return ( <> @@ -275,37 +275,48 @@ export function SceneProps() { - - { - if (display !== TankopediaDisplay.Dissector) return; + {display === TankopediaDisplay.Dissector && ( + + { + if ( + display !== TankopediaDisplay.Dissector || + !dissector.current || + event.point.distanceTo(dissector.current.position) > 1.5 + ) + return; - event.stopPropagation(); + event.stopPropagation(); - position.current.set( - event.nativeEvent.clientX, - event.nativeEvent.clientY, - ); - mutateTankopediaEphemeral((draft) => { - draft.controlsEnabled = false; - }); + position.current.set( + event.nativeEvent.clientX, + event.nativeEvent.clientY, + ); + mutateTankopediaEphemeral((draft) => { + draft.controlsEnabled = false; + }); - window.addEventListener('pointermove', handlePointerMove); - window.addEventListener('pointerup', handlePointerUp); - }} - > - - - - + window.addEventListener('pointermove', handlePointerMove); + window.addEventListener('pointerup', handlePointerUp); + }} + > + + + + + )} )}