Skip to content

Commit

Permalink
SelectionHelper: Add enabled property. (#26483)
Browse files Browse the repository at this point in the history
  • Loading branch information
puxiao committed Jul 24, 2023
1 parent a867a45 commit 11b7b5c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/jsm/interactive/SelectionHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ class SelectionHelper {
this.pointBottomRight = new Vector2();

this.isDown = false;
this.enabled = true;

this.onPointerDown = function ( event ) {

if ( this.enabled === false ) return;

this.isDown = true;
this.onSelectStart( event );

}.bind( this );

this.onPointerMove = function ( event ) {

if ( this.enabled === false ) return;

if ( this.isDown ) {

this.onSelectMove( event );
Expand All @@ -35,6 +40,8 @@ class SelectionHelper {

this.onPointerUp = function ( ) {

if ( this.enabled === false ) return;

this.isDown = false;
this.onSelectOver();

Expand Down

0 comments on commit 11b7b5c

Please sign in to comment.