Allow some navigation tools when selecting

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9565
This commit is contained in:
dsa-t 2021-12-07 23:00:39 +00:00 committed by Seth Hillbrand
parent da38a6e750
commit 9c619d8f4e
2 changed files with 46 additions and 0 deletions

View File

@ -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 cancelled = false; // Was the tool canceled while it was running?
@ -1301,6 +1314,16 @@ bool EE_SELECTION_TOOL::selectMultiple()
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 );

View File

@ -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 cancelled = false; // Was the tool cancelled while it was running?
@ -886,6 +899,16 @@ bool PCB_SELECTION_TOOL::selectMultiple()
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 );