reimplement: * ctrl + m1: quick clipper mode (quits one after split done) (in 2d)
This commit is contained in:
parent
522cac75dc
commit
a42709f80a
|
|
@ -35,6 +35,7 @@ GdkCursor* g_clipper_cursor;
|
||||||
|
|
||||||
ClipperPoints g_clipper_points( g_vector3_identity, g_vector3_identity, g_vector3_identity );
|
ClipperPoints g_clipper_points( g_vector3_identity, g_vector3_identity, g_vector3_identity );
|
||||||
bool g_clipper_flipped = false;
|
bool g_clipper_flipped = false;
|
||||||
|
bool g_clipper_quick = false;
|
||||||
|
|
||||||
/* preferences */
|
/* preferences */
|
||||||
bool g_clipper_caulk = true;
|
bool g_clipper_caulk = true;
|
||||||
|
|
@ -46,6 +47,12 @@ bool Clipper_get2pointsIn2d(){
|
||||||
return g_clipper_2pointsIn2d;
|
return g_clipper_2pointsIn2d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClipperModeQuick(){
|
||||||
|
g_clipper_quick = true;
|
||||||
|
ClipperMode(); //enable
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Clipper_ok(){
|
bool Clipper_ok(){
|
||||||
return GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip && plane3_valid( plane3_for_points( g_clipper_points._points ) );
|
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 )
|
if( g_clipper_resetFlip )
|
||||||
g_clipper_flipped = false;
|
g_clipper_flipped = false;
|
||||||
|
if( !isClipper )
|
||||||
|
g_clipper_quick = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -99,6 +108,8 @@ void Clipper_do( bool split ){
|
||||||
if( g_clipper_resetFlip )
|
if( g_clipper_resetFlip )
|
||||||
g_clipper_flipped = false;
|
g_clipper_flipped = false;
|
||||||
}
|
}
|
||||||
|
if( g_clipper_quick )
|
||||||
|
ClipperMode(); //disable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,5 +47,6 @@ void Clipper_Construct();
|
||||||
void Clipper_Destroy();
|
void Clipper_Destroy();
|
||||||
void Clipper_modeChanged( bool isClipper );
|
void Clipper_modeChanged( bool isClipper );
|
||||||
bool Clipper_get2pointsIn2d();
|
bool Clipper_get2pointsIn2d();
|
||||||
|
void ClipperModeQuick();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -5629,8 +5629,14 @@ void onMouseDown( const WindowVector& position, ButtonIdentifier button, Modifie
|
||||||
if ( button == c_button_select || ( button == c_button_select2 && modifiers != c_modifierNone ) ) {
|
if ( button == c_button_select || ( button == c_button_select2 && modifiers != c_modifierNone ) ) {
|
||||||
m_mouse_down = true;
|
m_mouse_down = true;
|
||||||
g_bAltResize_AltSelect = ( modifiers == c_modifierAlt );
|
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
|
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 ) ) {
|
) && m_manipulator.mouseDown( devicePosition ) ) {
|
||||||
g_mouseMovedCallback.insert( MouseEventCallback( Manipulator_::MouseMovedCaller( m_manipulator ) ) );
|
g_mouseMovedCallback.insert( MouseEventCallback( Manipulator_::MouseMovedCaller( m_manipulator ) ) );
|
||||||
g_mouseUpCallback.insert( MouseEventCallback( Manipulator_::MouseUpCaller( m_manipulator ) ) );
|
g_mouseUpCallback.insert( MouseEventCallback( Manipulator_::MouseUpCaller( m_manipulator ) ) );
|
||||||
|
|
|
||||||
|
|
@ -1123,7 +1123,7 @@ void XYWnd::SetViewType( VIEWTYPE viewType ){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ClipMode(){
|
bool isClipperMode(){
|
||||||
return GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip;
|
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() ) {
|
else if ( buttons == Zoom_buttons() ) {
|
||||||
Zoom_Begin( x, y );
|
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 );
|
NewBrushDrag_Begin( x, y );
|
||||||
}
|
}
|
||||||
// control mbutton = move camera
|
// control mbutton = move camera
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user