Add reselectItem action.

This commit is contained in:
Alex Shvartzkop
2023-10-08 02:41:17 +00:00
committed by dsa-t
parent 40f7d5cb52
commit 0fcb36bc2e
5 changed files with 24 additions and 4 deletions
+13 -1
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.TXT for contributors.
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -125,6 +125,18 @@ void SELECTION_TOOL::AddItemToSel( EDA_ITEM* aItem, bool aQuietMode )
}
int SELECTION_TOOL::ReselectItem( const TOOL_EVENT& aEvent )
{
RemoveItemFromSel( aEvent.Parameter<EDA_ITEM*>() );
selection().SetIsHover( false );
AddItemToSel( aEvent.Parameter<EDA_ITEM*>() );
selection().SetIsHover( false );
return 0;
}
int SELECTION_TOOL::AddItemsToSel( const TOOL_EVENT& aEvent )
{
AddItemsToSel( aEvent.Parameter<EDA_ITEMS*>(), false );