From b547c5cdf0895fab4cbd27f0ba68662199d54114 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 11 Jan 2018 22:12:46 -0500 Subject: [PATCH] Reapplied: Save view control settings before dispatching new tool events Unintentionally removed in b8ecc95d. --- common/tool/tool_manager.cpp | 5 +++++ pcbnew/tools/edit_tool.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index e88cb8d302..366e309d57 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -510,6 +510,9 @@ OPT TOOL_MANAGER::ScheduleWait( TOOL_BASE* aTool, void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent ) { + // Save current settings before overwriting with the dispatched tool + auto vc_settings = m_viewControls->GetSettings(); + // iterate over all registered tools for( auto it = m_activeTools.begin(); it != m_activeTools.end(); ++it ) { @@ -598,6 +601,8 @@ void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent ) if( finished ) break; // only the first tool gets the event } + + m_viewControls->ApplySettings( vc_settings ); } diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 728cd9018c..d6dae64428 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1201,6 +1201,11 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent ) view.SetVisible( &ruler, true ); view.Update( &ruler, KIGFX::GEOMETRY ); } + + else if( evt->IsClick( BUT_RIGHT ) ) + { + GetManager()->PassEvent(); + } } view.SetVisible( &ruler, false );