PCB_SELECTION_TOOL::selectPoint() Remove items disabled by the selection filter

before using any other filter. This avoid to select an item from the candidate
list that cannot be selected and eliminate another candidate.
Fixes #16755
https://gitlab.com/kicad/code/kicad/-/issues/16755
This commit is contained in:
jean-pierre charras 2024-01-26 19:12:59 +01:00
parent fb8f05fb34
commit 89f8c5d918
1 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013-2017 CERN * Copyright (C) 2013-2017 CERN
* Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2018-2024 KiCad Developers, see AUTHORS.txt for contributors.
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch> * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch> * @author Maciej Suminski <maciej.suminski@cern.ch>
* *
@ -752,6 +752,9 @@ bool PCB_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag,
m_selection.ClearReferencePoint(); m_selection.ClearReferencePoint();
// Apply the stateful filter (remove items disabled by the Selection Filter)
FilterCollectedItems( collector, false );
// Allow the client to do tool- or action-specific filtering to see if we can get down // Allow the client to do tool- or action-specific filtering to see if we can get down
// to a single item // to a single item
if( aClientFilter ) if( aClientFilter )
@ -759,9 +762,6 @@ bool PCB_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag,
FilterCollectorForHierarchy( collector, false ); FilterCollectorForHierarchy( collector, false );
// Apply the stateful filter
FilterCollectedItems( collector, false );
FilterCollectorForFootprints( collector, aWhere ); FilterCollectorForFootprints( collector, aWhere );
// For subtracting, we only want items that are selected // For subtracting, we only want items that are selected