]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'fab6205991b78b158852d0d5a86e4b73ae0c1d55' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 18:21:20 +0000 (20:21 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 18:21:20 +0000 (20:21 +0200)
1  2 
radiant/selection.cpp

index 9801d193b86ba99e32e384b474e1fd61470b3579,c7870d8bfee55518fa8f01401cd5a52fa15b8b7e..1ecd3624affb4cc1ec256850548d85b9cbe58cc7
@@@ -3599,12 -3648,31 +3652,31 @@@ void mouseDown( DeviceVector position )
  
  void mouseMoved( DeviceVector position ){
        m_current = device_constrained( position );
-       draw_area();
+       if( !m_mouse2 ){
+               draw_area();
+       }
+       else if( m_paintInitialized ){
+               getSelectionSystem().SelectPoint( *m_view, &position[0], &m_epsilon[0],
+                                                                               m_paintSelect ? RadiantSelectionSystem::eSelect : RadiantSelectionSystem::eDeselect,
+                                                                               ( m_state & c_modifier_face ) != c_modifierNone );
+       }
+       else{
+               DeviceVector delta( position - m_start );
+               if ( fabs( delta.x() ) > m_epsilon.x() || fabs( delta.y() ) > m_epsilon.y() ) {
+                       m_paintSelect = getSelectionSystem().SelectPoint_InitPaint( *m_view, &position[0], &m_epsilon[0], ( m_state & c_modifier_face ) != c_modifierNone );
+                       m_paintInitialized = true;
+               }
+       }
  }
 -typedef MemberCaller1<Selector_, DeviceVector, &Selector_::mouseMoved> MouseMovedCaller;
 +typedef MemberCaller<Selector_, void(DeviceVector), &Selector_::mouseMoved> MouseMovedCaller;
  
  void mouseUp( DeviceVector position ){
-       testSelect( device_constrained( position ) );
+       if( !m_paintInitialized ){
+               testSelect( device_constrained( position ) );
+       }
+       else{
+               m_start = m_current = DeviceVector( 0.0f, 0.0f );
+       }
  
        g_mouseMovedCallback.clear();
        g_mouseUpCallback.clear();