pcbnew: Zone selection heuristic continuity for edge
If the user is carefully selecting the zone edge, we do not filter the
zone preemptively from our disambiguation list in the same manner as we
do for selecting on zone copper.
Fixes: lp:1796719
* https://bugs.launchpad.net/kicad/+bug/1796719
(cherry picked from commit f11cb736e5
)
This commit is contained in:
parent
876232aa7a
commit
46f7011463
|
@ -527,7 +527,7 @@ bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag,
|
|||
// Apply some ugly heuristics to avoid disambiguation menus whenever possible
|
||||
if( !m_skip_heuristics )
|
||||
{
|
||||
guessSelectionCandidates( collector );
|
||||
guessSelectionCandidates( collector, aWhere );
|
||||
|
||||
if( collector.GetCount() == 1 )
|
||||
{
|
||||
|
@ -1956,7 +1956,8 @@ double calcRatio( double a, double b )
|
|||
// We currently check for pads and text mostly covering a footprint, but we don’t check for
|
||||
// smaller footprints mostly covering a larger footprint.
|
||||
//
|
||||
void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) const
|
||||
void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector,
|
||||
const VECTOR2I& aWhere ) const
|
||||
{
|
||||
std::set<BOARD_ITEM*> rejected;
|
||||
std::set<BOARD_ITEM*> forced;
|
||||
|
@ -2015,8 +2016,11 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
|
|||
{
|
||||
for( int i = aCollector.GetCount() - 1; i >= 0; i-- )
|
||||
{
|
||||
if( aCollector[i]->Type() == PCB_ZONE_AREA_T )
|
||||
if( aCollector[i]->Type() == PCB_ZONE_AREA_T && !static_cast<ZONE_CONTAINER*>
|
||||
( aCollector[i] )->HitTestForEdge( wxPoint( aWhere.x, aWhere.y ) ) )
|
||||
{
|
||||
aCollector.Remove( i );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -326,8 +326,9 @@ private:
|
|||
* Tries to guess best selection candidates in case multiple items are clicked, by
|
||||
* doing some braindead heuristics.
|
||||
* @param aCollector is the collector that has a list of items to be queried.
|
||||
* @param aWhere is the selection point to consider
|
||||
*/
|
||||
void guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) const;
|
||||
void guessSelectionCandidates( GENERAL_COLLECTOR& aCollector, const VECTOR2I& aWhere ) const;
|
||||
|
||||
/**
|
||||
* Event handler to update the selection VIEW_ITEM.
|
||||
|
|
Loading…
Reference in New Issue