pcbnew: Fix loop condition when unhighlighting modules

Text can be included in the same selection group as the parent module.
Thus if we clear the selection marker on a module's child elements we
also need to remove the element from the selection group.

Fixes: lp:1789418
* https://bugs.launchpad.net/kicad/+bug/1789418
This commit is contained in:
Seth Hillbrand 2018-08-30 09:25:36 -07:00
parent 01acc0d9be
commit d45946396c
1 changed files with 4 additions and 3 deletions

View File

@ -1844,10 +1844,11 @@ void SELECTION_TOOL::unhighlight( BOARD_ITEM* aItem, int aMode, SELECTION& aGrou
if( aMode == SELECTED )
item->ClearSelected();
else if( aMode == BRIGHTENED )
{
item->ClearBrightened();
aGroup.Remove( item );
}
// N.B. if we clear the selection flag for sub-elements, we need to also
// remove the element from the selection group (if it exists)
aGroup.Remove( item );
view()->Hide( item, false );
view()->Update( item );
});