From efaa131bc48ec94be4a075979d4e0483f88630b2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 26 Nov 2023 18:18:13 +0000 Subject: [PATCH] Position dummy tuning pattern before trying to get length out of it. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16165 --- pcbnew/generators/pcb_tuning_pattern.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/generators/pcb_tuning_pattern.cpp b/pcbnew/generators/pcb_tuning_pattern.cpp index d504a135e8..8063d47546 100644 --- a/pcbnew/generators/pcb_tuning_pattern.cpp +++ b/pcbnew/generators/pcb_tuning_pattern.cpp @@ -1717,6 +1717,8 @@ int DRAWING_TOOL::PlaceTuningPattern( const TOOL_EVENT& aEvent ) { dummyPattern.reset( PCB_TUNING_PATTERN::CreateNew( generatorTool, m_frame, m_pickerItem, mode, false ) ); + dummyPattern->SetPosition( m_pickerItem->GetPosition() ); + dummyPattern->SetEnd( m_pickerItem->GetPosition() ); } if( dummyPattern ) @@ -1729,6 +1731,8 @@ int DRAWING_TOOL::PlaceTuningPattern( const TOOL_EVENT& aEvent ) dummyPattern->UpdateStatus( generatorTool, m_frame, m_statusPopup.get() ); m_statusPopup->Move( KIPLATFORM::UI::GetMousePosition() + wxPoint( 20, 20 ) ); + + generatorTool->Router()->StopRouting(); } else {