Explorar o código

Examples: Improve SelectionHelper.js (#24322)

linbingquan %!s(int64=3) %!d(string=hai) anos
pai
achega
66eaa789e4
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      examples/jsm/interactive/SelectionHelper.js

+ 5 - 3
examples/jsm/interactive/SelectionHelper.js

@@ -1,6 +1,4 @@
-import {
-	Vector2
-} from 'three';
+import { Vector2 } from 'three';
 
 class SelectionHelper {
 
@@ -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';
@@ -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 );

粤ICP备19079148号