Favour junction dots to wires inside the dot.

Fixes https://gitlab.com/kicad/code/kicad/issues/9187
This commit is contained in:
Jeff Young 2021-09-23 22:13:32 +01:00
parent 552f053a55
commit 4b38bd1543
1 changed files with 7 additions and 3 deletions

View File

@ -43,6 +43,7 @@
#include <sch_edit_frame.h>
#include <sch_item.h>
#include <sch_line.h>
#include <sch_junction.h>
#include <sch_sheet.h>
#include <sch_sheet_pin.h>
#include <schematic.h>
@ -1022,10 +1023,13 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const
if( exactHits.count( item ) )
{
wxPoint pos( aPos );
SCH_LINE* line = dynamic_cast<SCH_LINE*>( item );
wxPoint pos( aPos );
SCH_LINE* line = dynamic_cast<SCH_LINE*>( item );
SCH_JUNCTION* junction = dynamic_cast<SCH_JUNCTION*>( item );
if( line )
if( junction )
dist = 0; // Hits *inside* a junction dot should select the dot
else if( line )
dist = DistanceLinePoint( line->GetStartPoint(), line->GetEndPoint(), pos );
else
dist = EuclideanNorm( bbox.GetCenter() - pos ) * 2;