* disable clipper cut action on doubleclick, if click has set second point
This commit is contained in:
parent
b5e9d98bc7
commit
78c97a6625
|
|
@ -36,6 +36,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;
|
||||
bool g_clipper_doubleclicked = false;
|
||||
|
||||
/* preferences */
|
||||
bool g_clipper_caulk = true;
|
||||
|
|
@ -68,6 +69,7 @@ void Clipper_update(){
|
|||
|
||||
void Clipper_setPlanePoints( const ClipperPoints& points ){
|
||||
g_clipper_points = points;
|
||||
// g_clipper_doubleclicked = false; //assuming, that new point was set... dragging in fact calls this too >_<
|
||||
Clipper_update();
|
||||
}
|
||||
|
||||
|
|
@ -147,6 +149,18 @@ void Clipper_doFlip(){
|
|||
}
|
||||
}
|
||||
|
||||
#include "timer.h"
|
||||
Timer g_clipper_timer;
|
||||
void Clipper_tryDoubleclick(){
|
||||
g_clipper_doubleclicked = g_clipper_timer.elapsed_msec() < 200 && Clipper_ok();
|
||||
g_clipper_timer.start();
|
||||
}
|
||||
|
||||
void Clipper_tryDoubleclickedCut(){
|
||||
if( g_clipper_doubleclicked )
|
||||
Clipper_doClip();
|
||||
}
|
||||
|
||||
#include "preferencesystem.h"
|
||||
#include "stringio.h"
|
||||
#include "preferences.h"
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ void Clipper_Destroy();
|
|||
void Clipper_modeChanged( bool isClipper );
|
||||
bool Clipper_get2pointsIn2d();
|
||||
void ClipperModeQuick();
|
||||
void Clipper_doClip();
|
||||
void Clipper_tryDoubleclick();
|
||||
void Clipper_tryDoubleclickedCut();
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3863,8 +3863,8 @@ public:
|
|||
Clipper_setPlanePoints( ClipperPoints( g_vector3_identity, g_vector3_identity, g_vector3_identity ) );
|
||||
}
|
||||
}
|
||||
std::size_t newPointIndex( const View& view ) const {
|
||||
const std::size_t maxi = ( !view.fill() && Clipper_get2pointsIn2d() )? 2 : 3;
|
||||
std::size_t newPointIndex( bool viewfill ) const {
|
||||
const std::size_t maxi = ( !viewfill && Clipper_get2pointsIn2d() )? 2 : 3;
|
||||
std::size_t i;
|
||||
for( i = 0; i < maxi; ++i )
|
||||
if( !m_points[i].m_set )
|
||||
|
|
@ -3877,7 +3877,7 @@ public:
|
|||
const std::size_t maxi = vector3_max_abs_component_index( viewdir );
|
||||
m_viewdir = ( viewdir[maxi] > 0 )? g_vector3_axes[maxi] : -g_vector3_axes[maxi];
|
||||
}
|
||||
const std::size_t i = newPointIndex( view );
|
||||
const std::size_t i = newPointIndex( view.fill() );
|
||||
if( i == 0 )
|
||||
m_points[1].m_set = m_points[2].m_set = false;
|
||||
m_points[i].m_set = true;
|
||||
|
|
@ -3959,7 +3959,7 @@ public:
|
|||
vector3_snap( point, GetSnapGridSize() );
|
||||
{
|
||||
const std::size_t maxi = vector3_max_abs_component_index( view.getViewDir() );
|
||||
const std::size_t i = newPointIndex( view );
|
||||
const std::size_t i = newPointIndex( false );
|
||||
point[maxi] = m_bounds.origin[maxi] + ( i == 2? -1 : 1 ) * m_bounds.extents[maxi];
|
||||
}
|
||||
newPoint( point, view );
|
||||
|
|
@ -5715,15 +5715,12 @@ void mouseUp( DeviceVector position ){
|
|||
typedef MemberCaller1<Selector_, DeviceVector, &Selector_::mouseUp> MouseUpCaller;
|
||||
};
|
||||
|
||||
#include "timer.h"
|
||||
|
||||
class Manipulator_
|
||||
{
|
||||
const DeviceVector& m_epsilon;
|
||||
const ModifierFlags& m_state;
|
||||
|
||||
Timer m_timer;
|
||||
bool m_timerDoubleClicked;
|
||||
|
||||
public:
|
||||
const View* m_view;
|
||||
|
||||
|
|
@ -5733,22 +5730,16 @@ bool m_mouseMovedWhilePressed;
|
|||
Manipulator_( const DeviceVector& epsilon, const ModifierFlags& state ) :
|
||||
m_epsilon( epsilon ),
|
||||
m_state( state ),
|
||||
m_timerDoubleClicked( false ),
|
||||
m_moving_transformOrigin( false ),
|
||||
m_mouseMovedWhilePressed( false ) {
|
||||
}
|
||||
|
||||
bool mouseDown( DeviceVector position ){
|
||||
m_timerDoubleClicked = m_timer.elapsed_msec() < 200;
|
||||
m_timer.start();
|
||||
if( getSelectionSystem().ManipulatorMode() == SelectionSystem::eClip )
|
||||
Clipper_tryDoubleclick();
|
||||
return getSelectionSystem().SelectManipulator( *m_view, &position[0], &m_epsilon[0] );
|
||||
}
|
||||
|
||||
void tryClipperDoubleClick() const {
|
||||
if( m_timerDoubleClicked && getSelectionSystem().ManipulatorMode() == SelectionSystem::eClip )
|
||||
Clipper_doClip();
|
||||
}
|
||||
|
||||
void mouseMoved( DeviceVector position ){
|
||||
if( m_mouseMovedWhilePressed )
|
||||
getSelectionSystem().MoveSelected( *m_view, &position[0], bitfield_enabled( m_state, c_modifierShift ),
|
||||
|
|
@ -5877,7 +5868,8 @@ void onMouseUp( const WindowVector& position, ButtonIdentifier button, ModifierF
|
|||
&& getSelectionSystem().ManipulatorMode() != SelectionSystem::eClip ){
|
||||
m_selector.testSelect_simpleM1( device( position ) );
|
||||
}
|
||||
m_manipulator.tryClipperDoubleClick();
|
||||
if( getSelectionSystem().ManipulatorMode() == SelectionSystem::eClip )
|
||||
Clipper_tryDoubleclickedCut();
|
||||
|
||||
m_manipulator.m_moving_transformOrigin = false;
|
||||
m_selector.m_mouseMoved = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user