Try and keep POINT_EDITOR and SELECTION_TOOL from fighting with drawing tool.
Set the IS_NEW flags so the POINT_EDITOR doesn't try an poke its head in, and apply the EE_SELECTION_TOOL hack for mouse clicks leaking through to the underlying tools. Fixes: lp:1832911 * https://bugs.launchpad.net/kicad/+bug/1832911
This commit is contained in:
parent
18ebced8f4
commit
945eaceb91
|
@ -116,13 +116,10 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
if( !m_editModules )
|
||||
{
|
||||
if( aCreateUndoEntry )
|
||||
{
|
||||
undoList.PushItem( ITEM_PICKER( boardItem, UR_NEW ) );
|
||||
}
|
||||
|
||||
if( !( changeFlags & CHT_DONE ) )
|
||||
board->Add( boardItem ); // handles connectivity
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -595,6 +595,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
|
|||
}
|
||||
|
||||
aBoardItem->SetParent( this );
|
||||
aBoardItem->ClearEditFlags();
|
||||
m_connectivity->Add( aBoardItem );
|
||||
}
|
||||
|
||||
|
|
|
@ -253,6 +253,7 @@ int DRAWING_TOOL::DrawLine( const TOOL_EVENT& aEvent )
|
|||
|
||||
BOARD_ITEM_CONTAINER* parent = m_frame->GetModel();
|
||||
DRAWSEGMENT* line = m_editModules ? new EDGE_MODULE( (MODULE*) parent ) : new DRAWSEGMENT;
|
||||
line->SetFlags( IS_NEW );
|
||||
|
||||
auto startingPoint = boost::make_optional<VECTOR2D>( false, VECTOR2D( 0, 0 ) );
|
||||
BOARD_COMMIT commit( m_frame );
|
||||
|
@ -282,6 +283,7 @@ int DRAWING_TOOL::DrawLine( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
line = m_editModules ? new EDGE_MODULE( (MODULE*) parent ) : new DRAWSEGMENT;
|
||||
line->SetFlags( IS_NEW );
|
||||
}
|
||||
|
||||
m_frame->SetNoToolSelected();
|
||||
|
@ -299,6 +301,8 @@ int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent )
|
|||
DRAWSEGMENT* circle = m_editModules ? new EDGE_MODULE( (MODULE*) parent ) : new DRAWSEGMENT;
|
||||
BOARD_COMMIT commit( m_frame );
|
||||
|
||||
circle->SetFlags( IS_NEW );
|
||||
|
||||
SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::CIRCLE );
|
||||
|
||||
m_frame->SetToolID( m_editModules ? ID_MODEDIT_CIRCLE_TOOL : ID_PCB_CIRCLE_BUTT,
|
||||
|
@ -319,6 +323,7 @@ int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
circle = m_editModules ? new EDGE_MODULE( (MODULE*) parent ) : new DRAWSEGMENT;
|
||||
circle->SetFlags( IS_NEW );
|
||||
}
|
||||
|
||||
m_frame->SetNoToolSelected();
|
||||
|
@ -338,6 +343,8 @@ int DRAWING_TOOL::DrawArc( const TOOL_EVENT& aEvent )
|
|||
|
||||
SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::ARC );
|
||||
|
||||
arc->SetFlags( IS_NEW );
|
||||
|
||||
m_frame->SetToolID( m_editModules ? ID_MODEDIT_ARC_TOOL : ID_PCB_ARC_BUTT,
|
||||
wxCURSOR_PENCIL, _( "Add graphic arc" ) );
|
||||
|
||||
|
@ -356,6 +363,7 @@ int DRAWING_TOOL::DrawArc( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
arc = m_editModules ? new EDGE_MODULE( (MODULE*) parent ) : new DRAWSEGMENT;
|
||||
arc->SetFlags( IS_NEW );
|
||||
}
|
||||
|
||||
m_frame->SetNoToolSelected();
|
||||
|
@ -1130,6 +1138,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic, OPT<VECTOR2D
|
|||
if( snapItem && aGraphic->GetLength() > 0.0 )
|
||||
{
|
||||
DRAWSEGMENT* l = m_editModules ? new EDGE_MODULE( mod ) : new DRAWSEGMENT;
|
||||
l->SetFlags( IS_NEW );
|
||||
|
||||
*l = *aGraphic;
|
||||
commit.Add( l );
|
||||
|
|
|
@ -52,6 +52,7 @@ using namespace std::placeholders;
|
|||
#include <router/router_tool.h>
|
||||
#include <connectivity/connectivity_data.h>
|
||||
#include <footprint_viewer_frame.h>
|
||||
#include <id.h>
|
||||
#include "tool_event_utils.h"
|
||||
#include "selection_tool.h"
|
||||
#include "pcb_bright_box.h"
|
||||
|
@ -87,14 +88,14 @@ TOOL_ACTION PCB_ACTIONS::selectionMenu( "pcbnew.InteractiveSelection.SelectionMe
|
|||
TOOL_ACTION PCB_ACTIONS::selectConnection( "pcbnew.InteractiveSelection.SelectConnection",
|
||||
AS_GLOBAL,
|
||||
'U', LEGACY_HK_NAME( "Select Single Track" ),
|
||||
_( "Single Track" ),
|
||||
_( "Select Single Track" ),
|
||||
_( "Selects all track segments & vias between two junctions." ),
|
||||
add_tracks_xpm );
|
||||
|
||||
TOOL_ACTION PCB_ACTIONS::selectCopper( "pcbnew.InteractiveSelection.SelectCopper",
|
||||
AS_GLOBAL,
|
||||
'I', LEGACY_HK_NAME( "Select Connected Tracks" ),
|
||||
_( "Connected Tracks" ),
|
||||
_( "Select Connected Tracks" ),
|
||||
_( "Selects all connected tracks & vias." ),
|
||||
net_highlight_xpm );
|
||||
|
||||
|
@ -105,7 +106,7 @@ TOOL_ACTION PCB_ACTIONS::expandSelectedConnection( "pcbnew.InteractiveSelection.
|
|||
|
||||
TOOL_ACTION PCB_ACTIONS::selectNet( "pcbnew.InteractiveSelection.SelectNet",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "All Tracks in Net" ),
|
||||
_( "Select All Tracks in Net" ),
|
||||
_( "Selects all tracks & vias belonging to the same net." ),
|
||||
mode_track_xpm );
|
||||
|
||||
|
@ -277,6 +278,11 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
// Single click? Select single object
|
||||
if( evt->IsClick( BUT_LEFT ) )
|
||||
{
|
||||
// JEY TODO: this is a hack, but I can't figure out why it's needed to
|
||||
// keep from getting end-of-segment clicks when running the Draw Lines tool.
|
||||
if( m_frame->GetToolId() != ID_NO_TOOL_SELECTED )
|
||||
continue;
|
||||
|
||||
if( evt->Modifier( MD_CTRL ) && !m_editModules )
|
||||
{
|
||||
m_toolMgr->RunAction( PCB_ACTIONS::highlightNet, true );
|
||||
|
|
Loading…
Reference in New Issue