]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge commit '09b97bb415e380e5eaf6e2f4acbdc7f740494b41' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 18:20:45 +0000 (20:20 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 18:20:45 +0000 (20:20 +0200)
radiant/mainframe.h
radiant/xywindow.cpp

index 85e60f47eb6ba671cc61c10c75d90c276b2df0c2..ca8c79c64e6fc641afc03e387e6188c4d40fd8ea 100644 (file)
@@ -237,6 +237,7 @@ void UpdateAllWindows();
 
 
 void ClipperChangeNotify();
+void ClipperMode();
 
 void DefaultMode();
 
index daf0a3c94f71163457ed02226287bd651395461a..85f77eb531d5e9b0a2b3700eb6c2edc90e1ef63c 100644 (file)
@@ -112,6 +112,7 @@ void Draw( const char *label, float scale );
 VIEWTYPE g_clip_viewtype;
 bool g_bSwitch = true;
 bool g_clip_useCaulk = false;
+bool g_quick_clipper = false;
 ClipPoint g_Clip1;
 ClipPoint g_Clip2;
 ClipPoint g_Clip3;
@@ -260,6 +261,10 @@ void Clip(){
                g_Clip3.Reset();
                Clip_Update();
                ClipperChangeNotify();
+               if( g_quick_clipper ){
+                       g_quick_clipper = false;
+                       ClipperMode();
+               }
        }
 }
 
@@ -274,6 +279,10 @@ void SplitClip(){
                g_Clip3.Reset();
                Clip_Update();
                ClipperChangeNotify();
+               if( g_quick_clipper ){
+                       g_quick_clipper = false;
+                       ClipperMode();
+               }
        }
 }
 
@@ -928,6 +937,10 @@ unsigned int Clipper_buttons(){
        return RAD_LBUTTON;
 }
 
+unsigned int Clipper_quick_buttons(){
+       return RAD_RBUTTON | RAD_CONTROL;
+}
+
 void XYWnd::DropClipPoint( int pointx, int pointy ){
        Vector3 point;
 
@@ -1303,7 +1316,12 @@ void XYWnd::XY_MouseDown( int x, int y, unsigned int buttons ){
        else if ( buttons == Zoom_buttons() ) {
                Zoom_Begin();
        }
-       else if ( ClipMode() && buttons == Clipper_buttons() ) {
+       else if ( ClipMode() && ( buttons == Clipper_buttons() || buttons == Clipper_quick_buttons() ) ) {
+               Clipper_OnLButtonDown( x, y );
+       }
+       else if ( !ClipMode() && buttons == Clipper_quick_buttons() ) {
+               ClipperMode();
+               g_quick_clipper = true;
                Clipper_OnLButtonDown( x, y );
        }
        else if ( buttons == NewBrushDrag_buttons() && GlobalSelectionSystem().countSelected() == 0 ) {
@@ -1331,7 +1349,7 @@ void XYWnd::XY_MouseUp( int x, int y, unsigned int buttons ){
        else if ( m_zoom_started ) {
                Zoom_End();
        }
-       else if ( ClipMode() && buttons == Clipper_buttons() ) {
+       else if ( ClipMode() && ( buttons == Clipper_buttons() || buttons == Clipper_quick_buttons() ) ) {
                Clipper_OnLButtonUp( x, y );
        }
        else if ( m_bNewBrushDrag ) {