File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -241,9 +241,11 @@ function initTransformControls() {
241241 pointer . y = - ( ( event . clientY - rect . top ) / rect . height ) * 2 + 1 ;
242242 raycaster . setFromCamera ( pointer , camera ) ;
243243
244- // If the click lands on the gizmo arc handles, do not dismiss it.
245- const gizmoHits = raycaster . intersectObject ( transformControls . getHelper ( ) , true ) ;
246- if ( gizmoHits . length > 0 ) return ;
244+ // If the gizmo is attached and the click lands on the arc handles, do not dismiss it.
245+ if ( transformControls . object ) {
246+ const gizmoHits = raycaster . intersectObject ( transformControls . getHelper ( ) , true ) ;
247+ if ( gizmoHits . length > 0 ) return ;
248+ }
247249
248250 const hits = raycaster . intersectObject ( meshObject , true ) ;
249251 if ( hits . length > 0 ) {
You can’t perform that action at this time.
0 commit comments