Reapplied: Save view control settings before dispatching new tool events

Unintentionally removed in b8ecc95d.
This commit is contained in:
Jon Evans 2018-01-11 22:12:46 -05:00 committed by Maciej Suminski
parent 7a6e3bf3ed
commit b547c5cdf0
2 changed files with 10 additions and 0 deletions

View File

@ -510,6 +510,9 @@ OPT<TOOL_EVENT> TOOL_MANAGER::ScheduleWait( TOOL_BASE* aTool,
void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent ) 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 // iterate over all registered tools
for( auto it = m_activeTools.begin(); it != m_activeTools.end(); ++it ) 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 ) if( finished )
break; // only the first tool gets the event break; // only the first tool gets the event
} }
m_viewControls->ApplySettings( vc_settings );
} }

View File

@ -1201,6 +1201,11 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
view.SetVisible( &ruler, true ); view.SetVisible( &ruler, true );
view.Update( &ruler, KIGFX::GEOMETRY ); view.Update( &ruler, KIGFX::GEOMETRY );
} }
else if( evt->IsClick( BUT_RIGHT ) )
{
GetManager()->PassEvent();
}
} }
view.SetVisible( &ruler, false ); view.SetVisible( &ruler, false );