Force immediate action for auto start wire feature
Fixes https://gitlab.com/kicad/code/kicad/issues/7503
This commit is contained in:
parent
3bc9d7b95e
commit
f9c42585fb
|
@ -61,6 +61,8 @@ void TOOL_EVENT::init()
|
|||
// Cancel tool doesn't contain a position
|
||||
if( IsCancel() )
|
||||
m_hasPosition = false;
|
||||
|
||||
m_forceImmediate = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1118,7 +1118,8 @@ bool TOOL_MANAGER::processEvent( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
// An tool-selection-event has no position
|
||||
if( mod_event.GetCommandStr().is_initialized()
|
||||
&& mod_event.GetCommandStr().get() != GetToolHolder()->CurrentToolName() )
|
||||
&& mod_event.GetCommandStr().get() != GetToolHolder()->CurrentToolName()
|
||||
&& !mod_event.ForceImmediate() )
|
||||
{
|
||||
mod_event.SetHasPosition( false );
|
||||
}
|
||||
|
|
|
@ -401,6 +401,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
getViewControls()->ForceCursorPosition( true, snappedCursorPos );
|
||||
newEvt->SetMousePosition( snappedCursorPos );
|
||||
newEvt->SetHasPosition( true );
|
||||
newEvt->SetForceImmediate( true );
|
||||
m_toolMgr->ProcessEvent( *newEvt );
|
||||
|
||||
continueSelect = false;
|
||||
|
|
|
@ -258,6 +258,11 @@ public:
|
|||
bool HasPosition() const { return m_hasPosition; }
|
||||
void SetHasPosition( bool aHasPosition ) { m_hasPosition = aHasPosition; }
|
||||
|
||||
///< Returns if the action associated with this event should be treated as immediate regardless
|
||||
///< of the current immediate action settings.
|
||||
bool ForceImmediate() const { return m_forceImmediate; }
|
||||
void SetForceImmediate( bool aForceImmediate = true ) { m_forceImmediate = aForceImmediate; }
|
||||
|
||||
TOOL_BASE* FirstResponder() const { return m_firstResponder; }
|
||||
void SetFirstResponder( TOOL_BASE* aTool ) { m_firstResponder = aTool; }
|
||||
|
||||
|
@ -520,6 +525,7 @@ private:
|
|||
TOOL_ACTION_SCOPE m_scope;
|
||||
bool m_passEvent;
|
||||
bool m_hasPosition;
|
||||
bool m_forceImmediate;
|
||||
|
||||
///< Difference between mouse cursor position and
|
||||
///< the point where dragging event has started
|
||||
|
|
Loading…
Reference in New Issue