From 68125a7f50eb5eeea886c3bcabc358f44c2d95be Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 22 Aug 2013 15:05:37 +0200 Subject: [PATCH] Changed reaction of SELECTION_TOOL to ToolCancel event (first event clears selection, second one deactivates the tool). --- pcbnew/tools/selection_tool.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index a7ac0c682d..797225b3ca 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -72,7 +72,12 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) m_additive = evt->Modifier( MD_ModShift ); if( evt->IsCancel() ) - return 0; + { + if( !m_selectedItems.empty() ) + clearSelection(); + else + return 0; + } // single click? Select single object if( evt->IsClick( MB_Left ) ) @@ -242,7 +247,7 @@ void SELECTION_TOOL::selectMultiple() } -BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR *aCollector ) +BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector ) { OPT_TOOL_EVENT evt; BOARD_ITEM* current = NULL;