Don't leave a hidden item behind.
If the object changes between a TA_CONTEXT_MENU_UPDATE event and a TA_CONTEXT_MENU_CHOICE event (usually as a result of a cancel), the old code would leave the last item hidden. Fixes: lp:1737562 * https://bugs.launchpad.net/kicad/+bug/1737562
This commit is contained in:
parent
dc9d17100b
commit
df76380a2d
|
@ -1364,6 +1364,14 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector )
|
|||
}
|
||||
else if( evt->Action() == TA_CONTEXT_MENU_CHOICE )
|
||||
{
|
||||
if( current )
|
||||
{
|
||||
current->ClearBrightened();
|
||||
getView()->Hide( current, false );
|
||||
highlightGroup.Remove( current );
|
||||
getView()->MarkTargetDirty( KIGFX::TARGET_OVERLAY );
|
||||
}
|
||||
|
||||
OPT<int> id = evt->GetCommandId();
|
||||
|
||||
// User has selected an item, so this one will be returned
|
||||
|
@ -1375,14 +1383,6 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector )
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( current && current->IsBrightened() )
|
||||
{
|
||||
current->ClearBrightened();
|
||||
getView()->Hide( current, false );
|
||||
getView()->MarkTargetDirty( KIGFX::TARGET_OVERLAY );
|
||||
}
|
||||
|
||||
getView()->Remove( &highlightGroup );
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue