Don't override the router tool with drag actions

Before processing the select tool actions, we check if the router is
currently active and if it is, pass the event for processing in other
tools

Fixes https://gitlab.com/kicad/code/kicad/issues/7021
This commit is contained in:
Seth Hillbrand 2021-01-12 15:43:13 -08:00
parent 26524ef41e
commit 6ed2a831d8
1 changed files with 8 additions and 1 deletions

View File

@ -45,6 +45,7 @@ using namespace std::placeholders;
#include <view/view_controls.h> #include <view/view_controls.h>
#include <preview_items/selection_area.h> #include <preview_items/selection_area.h>
#include <painter.h> #include <painter.h>
#include <router/router_tool.h>
#include <bitmaps.h> #include <bitmaps.h>
#include <pcbnew_settings.h> #include <pcbnew_settings.h>
#include <tool/tool_event.h> #include <tool/tool_event.h>
@ -282,9 +283,15 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
bool modifier_enabled = m_subtractive || m_additive || m_exclusive_or; bool modifier_enabled = m_subtractive || m_additive || m_exclusive_or;
PCB_BASE_FRAME* frame = getEditFrame<PCB_BASE_FRAME>(); PCB_BASE_FRAME* frame = getEditFrame<PCB_BASE_FRAME>();
bool brd_editor = frame && frame->IsType( FRAME_PCB_EDITOR ); bool brd_editor = frame && frame->IsType( FRAME_PCB_EDITOR );
ROUTER_TOOL* router = m_toolMgr->GetTool<ROUTER_TOOL>();
// If the router tool is active, don't override
if( router && router->IsToolActive() )
{
evt->SetPassEvent();
}
// Single click? Select single object // Single click? Select single object
if( evt->IsClick( BUT_LEFT ) ) else if( evt->IsClick( BUT_LEFT ) )
{ {
if( highlight_modifier && brd_editor ) if( highlight_modifier && brd_editor )
m_toolMgr->RunAction( PCB_ACTIONS::highlightNet, true ); m_toolMgr->RunAction( PCB_ACTIONS::highlightNet, true );