Position dummy tuning pattern before trying to get length out of it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16165
This commit is contained in:
Jeff Young 2023-11-26 18:18:13 +00:00
parent ad70b50046
commit efaa131bc4
1 changed files with 4 additions and 0 deletions

View File

@ -1717,6 +1717,8 @@ int DRAWING_TOOL::PlaceTuningPattern( const TOOL_EVENT& aEvent )
{ {
dummyPattern.reset( PCB_TUNING_PATTERN::CreateNew( generatorTool, m_frame, dummyPattern.reset( PCB_TUNING_PATTERN::CreateNew( generatorTool, m_frame,
m_pickerItem, mode, false ) ); m_pickerItem, mode, false ) );
dummyPattern->SetPosition( m_pickerItem->GetPosition() );
dummyPattern->SetEnd( m_pickerItem->GetPosition() );
} }
if( dummyPattern ) if( dummyPattern )
@ -1729,6 +1731,8 @@ int DRAWING_TOOL::PlaceTuningPattern( const TOOL_EVENT& aEvent )
dummyPattern->UpdateStatus( generatorTool, m_frame, m_statusPopup.get() ); dummyPattern->UpdateStatus( generatorTool, m_frame, m_statusPopup.get() );
m_statusPopup->Move( KIPLATFORM::UI::GetMousePosition() + wxPoint( 20, 20 ) ); m_statusPopup->Move( KIPLATFORM::UI::GetMousePosition() + wxPoint( 20, 20 ) );
generatorTool->Router()->StopRouting();
} }
else else
{ {