소스 검색

TransformControls: Set axis before triggering mouseDownEvent

In my case for example I have a listener to the mousedown event. In this listener I check for the current set axis. But of course it is ```null``` because it is set just after the event was triggered.
So my suggestion is to set the axis and AFTERWARDS trigger the event.
Pascal Häusler 7 년 전
부모
커밋
7de3906eb4
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      examples/js/controls/TransformControls.js

+ 2 - 2
examples/js/controls/TransformControls.js

@@ -856,10 +856,10 @@
 					event.preventDefault();
 					event.stopPropagation();
 
-					scope.dispatchEvent( mouseDownEvent );
-
 					scope.axis = intersect.object.name;
 
+					scope.dispatchEvent( mouseDownEvent );
+
 					scope.update();
 
 					eye.copy( camPosition ).sub( worldPosition ).normalize();