Skip to content

Commit c89ecf2

Browse files
author
Avaer Kazmer
committed
Add TransformControls draggable support
1 parent e21977e commit c89ecf2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

TransformControls.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ THREE.TransformControls = function ( camera, domElement ) {
2525
defineProperty( "camera", camera );
2626
defineProperty( "object", undefined );
2727
defineProperty( "enabled", true );
28+
defineProperty( "draggable", true );
2829
defineProperty( "axis", null );
2930
defineProperty( "mode", "translate" );
3031
defineProperty( "translationSnap", null );
@@ -572,7 +573,7 @@ THREE.TransformControls = function ( camera, domElement ) {
572573

573574
function onPointerDown( event ) {
574575

575-
if ( ! scope.enabled ) return;
576+
if ( ! scope.enabled || ! scope.draggable ) return;
576577

577578
document.addEventListener( "mousemove", onPointerMove, false );
578579

@@ -583,15 +584,15 @@ THREE.TransformControls = function ( camera, domElement ) {
583584

584585
function onPointerMove( event ) {
585586

586-
if ( ! scope.enabled ) return;
587+
if ( ! scope.enabled || ! scope.draggable ) return;
587588

588589
scope.pointerMove( getPointer( event ) );
589590

590591
}
591592

592593
function onPointerUp( event ) {
593594

594-
if ( ! scope.enabled ) return;
595+
if ( ! scope.enabled || ! scope.draggable ) return;
595596

596597
document.removeEventListener( "mousemove", onPointerMove, false );
597598

0 commit comments

Comments
 (0)