Просмотр исходного кода

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 лет назад
Родитель
Сommit
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();