From 7aa7e3fd437a103ae59ddc4853d6b14c4a4aff87 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 8 Feb 2021 12:50:29 +0000 Subject: [PATCH] Push undo/redo blocking down a level in LengthTuner tool. This way it's active only while tuning a single line, rather than while the tool is selected. Fixes https://gitlab.com/kicad/code/kicad/issues/7462 --- pcbnew/router/length_tuner_tool.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pcbnew/router/length_tuner_tool.cpp b/pcbnew/router/length_tuner_tool.cpp index 59abfbc97b..bd6ae90f1d 100644 --- a/pcbnew/router/length_tuner_tool.cpp +++ b/pcbnew/router/length_tuner_tool.cpp @@ -171,6 +171,7 @@ void LENGTH_TUNER_TOOL::performTuning() auto placer = static_cast( m_router->Placer() ); placer->UpdateSettings( m_savedMeanderSettings ); + frame()->UndoRedoBlock( true ); VECTOR2I end = getViewControls()->GetMousePosition(); @@ -252,6 +253,8 @@ void LENGTH_TUNER_TOOL::performTuning() } m_router->StopRouting(); + frame()->UndoRedoBlock( false ); + controls()->SetAutoPan( false ); controls()->ForceCursorPosition( false ); frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); @@ -279,7 +282,6 @@ int LENGTH_TUNER_TOOL::MainLoop( const TOOL_EVENT& aEvent ) m_router->SetMode( aEvent.Parameter() ); controls()->ShowCursor( true ); - frame()->UndoRedoBlock( true ); auto setCursor = [&]() @@ -317,10 +319,12 @@ int LENGTH_TUNER_TOOL::MainLoop( const TOOL_EVENT& aEvent ) { m_menu.ShowContextMenu( selection() ); } + else + { + evt->SetPassEvent(); + } } - frame()->UndoRedoBlock( false ); - // Store routing settings till the next invocation m_savedSizes = m_router->Sizes();