Allow some navigation tools when selecting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9565
This commit is contained in:
parent
da38a6e750
commit
9c619d8f4e
|
@ -1159,6 +1159,19 @@ void EE_SELECTION_TOOL::updateReferencePoint()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Some navigation actions are allowed in selectMultiple
|
||||||
|
const TOOL_ACTION* allowedActions[] = { &ACTIONS::panUp, &ACTIONS::panDown,
|
||||||
|
&ACTIONS::panLeft, &ACTIONS::panRight,
|
||||||
|
&ACTIONS::cursorUp, &ACTIONS::cursorDown,
|
||||||
|
&ACTIONS::cursorLeft, &ACTIONS::cursorRight,
|
||||||
|
&ACTIONS::cursorUpFast, &ACTIONS::cursorDownFast,
|
||||||
|
&ACTIONS::cursorLeftFast, &ACTIONS::cursorRightFast,
|
||||||
|
&ACTIONS::zoomIn, &ACTIONS::zoomOut,
|
||||||
|
&ACTIONS::zoomInCenter, &ACTIONS::zoomOutCenter,
|
||||||
|
&ACTIONS::zoomCenter, &ACTIONS::zoomFitScreen,
|
||||||
|
&ACTIONS::zoomFitObjects, nullptr };
|
||||||
|
|
||||||
|
|
||||||
bool EE_SELECTION_TOOL::selectMultiple()
|
bool EE_SELECTION_TOOL::selectMultiple()
|
||||||
{
|
{
|
||||||
bool cancelled = false; // Was the tool canceled while it was running?
|
bool cancelled = false; // Was the tool canceled while it was running?
|
||||||
|
@ -1301,6 +1314,16 @@ bool EE_SELECTION_TOOL::selectMultiple()
|
||||||
|
|
||||||
break; // Stop waiting for events
|
break; // Stop waiting for events
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow some actions for navigation
|
||||||
|
for( int i = 0; allowedActions[i]; ++i )
|
||||||
|
{
|
||||||
|
if( evt->IsAction( allowedActions[i] ) )
|
||||||
|
{
|
||||||
|
evt->SetPassEvent();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getViewControls()->SetAutoPan( false );
|
getViewControls()->SetAutoPan( false );
|
||||||
|
|
|
@ -770,6 +770,19 @@ bool PCB_SELECTION_TOOL::selectCursor( bool aForceSelect, CLIENT_SELECTION_FILTE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Some navigation actions are allowed in selectMultiple
|
||||||
|
const TOOL_ACTION* allowedActions[] = { &ACTIONS::panUp, &ACTIONS::panDown,
|
||||||
|
&ACTIONS::panLeft, &ACTIONS::panRight,
|
||||||
|
&ACTIONS::cursorUp, &ACTIONS::cursorDown,
|
||||||
|
&ACTIONS::cursorLeft, &ACTIONS::cursorRight,
|
||||||
|
&ACTIONS::cursorUpFast, &ACTIONS::cursorDownFast,
|
||||||
|
&ACTIONS::cursorLeftFast, &ACTIONS::cursorRightFast,
|
||||||
|
&ACTIONS::zoomIn, &ACTIONS::zoomOut,
|
||||||
|
&ACTIONS::zoomInCenter, &ACTIONS::zoomOutCenter,
|
||||||
|
&ACTIONS::zoomCenter, &ACTIONS::zoomFitScreen,
|
||||||
|
&ACTIONS::zoomFitObjects, nullptr };
|
||||||
|
|
||||||
|
|
||||||
bool PCB_SELECTION_TOOL::selectMultiple()
|
bool PCB_SELECTION_TOOL::selectMultiple()
|
||||||
{
|
{
|
||||||
bool cancelled = false; // Was the tool cancelled while it was running?
|
bool cancelled = false; // Was the tool cancelled while it was running?
|
||||||
|
@ -886,6 +899,16 @@ bool PCB_SELECTION_TOOL::selectMultiple()
|
||||||
|
|
||||||
break; // Stop waiting for events
|
break; // Stop waiting for events
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow some actions for navigation
|
||||||
|
for( int i = 0; allowedActions[i]; ++i )
|
||||||
|
{
|
||||||
|
if( evt->IsAction( allowedActions[i] ) )
|
||||||
|
{
|
||||||
|
evt->SetPassEvent();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getViewControls()->SetAutoPan( false );
|
getViewControls()->SetAutoPan( false );
|
||||||
|
|
Loading…
Reference in New Issue