reimplement: * ctrl + m1: quick clipper mode (quits one after split done) (in 2d)

This commit is contained in:
Garux 2018-05-11 02:27:52 +03:00
parent 522cac75dc
commit a42709f80a
4 changed files with 21 additions and 3 deletions

View File

@ -35,6 +35,7 @@ GdkCursor* g_clipper_cursor;
ClipperPoints g_clipper_points( g_vector3_identity, g_vector3_identity, g_vector3_identity );
bool g_clipper_flipped = false;
bool g_clipper_quick = false;
/* preferences */
bool g_clipper_caulk = true;
@ -46,6 +47,12 @@ bool Clipper_get2pointsIn2d(){
return g_clipper_2pointsIn2d;
}
void ClipperModeQuick(){
g_clipper_quick = true;
ClipperMode(); //enable
}
bool Clipper_ok(){
return GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip && plane3_valid( plane3_for_points( g_clipper_points._points ) );
}
@ -86,6 +93,8 @@ void Clipper_modeChanged( bool isClipper ){
if( g_clipper_resetFlip )
g_clipper_flipped = false;
if( !isClipper )
g_clipper_quick = false;
}
@ -99,6 +108,8 @@ void Clipper_do( bool split ){
if( g_clipper_resetFlip )
g_clipper_flipped = false;
}
if( g_clipper_quick )
ClipperMode(); //disable
}

View File

@ -47,5 +47,6 @@ void Clipper_Construct();
void Clipper_Destroy();
void Clipper_modeChanged( bool isClipper );
bool Clipper_get2pointsIn2d();
void ClipperModeQuick();
#endif

View File

@ -5629,8 +5629,14 @@ void onMouseDown( const WindowVector& position, ButtonIdentifier button, Modifie
if ( button == c_button_select || ( button == c_button_select2 && modifiers != c_modifierNone ) ) {
m_mouse_down = true;
g_bAltResize_AltSelect = ( modifiers == c_modifierAlt );
const bool clipper2d( !m_manipulator.m_view->fill() && button == c_button_select && modifiers == c_modifierControl );
if( clipper2d && getSelectionSystem().ManipulatorMode() != SelectionSystem::eClip )
ClipperModeQuick();
if ( ( modifiers == c_modifier_manipulator
|| ( modifiers == c_modifierAlt && getSelectionSystem().Mode() == SelectionSystem::ePrimitive )
|| clipper2d
|| ( modifiers == c_modifierAlt && getSelectionSystem().Mode() == SelectionSystem::ePrimitive ) /* AltResize */
) && m_manipulator.mouseDown( devicePosition ) ) {
g_mouseMovedCallback.insert( MouseEventCallback( Manipulator_::MouseMovedCaller( m_manipulator ) ) );
g_mouseUpCallback.insert( MouseEventCallback( Manipulator_::MouseUpCaller( m_manipulator ) ) );

View File

@ -1123,7 +1123,7 @@ void XYWnd::SetViewType( VIEWTYPE viewType ){
}
bool ClipMode(){
bool isClipperMode(){
return GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip;
}
@ -1138,7 +1138,7 @@ void XYWnd::XY_MouseDown( int x, int y, unsigned int buttons ){
else if ( buttons == Zoom_buttons() ) {
Zoom_Begin( x, y );
}
else if ( buttons == NewBrushDrag_buttons() && GlobalSelectionSystem().countSelected() == 0 && !ClipMode() ) {
else if ( buttons == NewBrushDrag_buttons() && GlobalSelectionSystem().countSelected() == 0 && !isClipperMode() ) {
NewBrushDrag_Begin( x, y );
}
// control mbutton = move camera