Skip to content

Commit

Permalink
Examples: Improve SelectionHelper.js (#24322)
Browse files Browse the repository at this point in the history
  • Loading branch information
linbingquan authored Jul 7, 2022
1 parent 6a2ff15 commit 66eaa78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/jsm/interactive/SelectionHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
Vector2
} from 'three';
import { Vector2 } from 'three';

class SelectionHelper {

Expand Down Expand Up @@ -58,6 +56,8 @@ class SelectionHelper {

onSelectStart( event ) {

this.element.style.display = 'none';

this.renderer.domElement.parentElement.appendChild( this.element );

this.element.style.left = event.clientX + 'px';
Expand All @@ -72,6 +72,8 @@ class SelectionHelper {

onSelectMove( event ) {

this.element.style.display = 'block';

this.pointBottomRight.x = Math.max( this.startPoint.x, event.clientX );
this.pointBottomRight.y = Math.max( this.startPoint.y, event.clientY );
this.pointTopLeft.x = Math.min( this.startPoint.x, event.clientX );
Expand Down

0 comments on commit 66eaa78

Please sign in to comment.