Explorar o código

retain down (x,y) even if click is taken

Former-commit-id: 3a161df2beead6d3e54c2f1bfe7226208113ffa8
Alec Jacobson %!s(int64=9) %!d(string=hai) anos
pai
achega
8b189ee40c
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      include/igl/viewer/Viewer.cpp

+ 4 - 2
include/igl/viewer/Viewer.cpp

@@ -561,6 +561,10 @@ namespace viewer
 
   IGL_INLINE bool Viewer::mouse_down(MouseButton button,int modifier)
   {
+    // Remember mouse location at down even if used by callback/plugin
+    down_mouse_x = current_mouse_x;
+    down_mouse_y = current_mouse_y;
+
     if (callback_mouse_down)
       if (callback_mouse_down(*this,static_cast<int>(button),modifier))
         return true;
@@ -571,8 +575,6 @@ namespace viewer
 
     down = true;
 
-    down_mouse_x = current_mouse_x;
-    down_mouse_y = current_mouse_y;
     down_translation = core.model_translation;