7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-04 23:05:30 +00:00

Use ORIGIN_TRANSFORMS in Mover Corner To... dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18479
This commit is contained in:
Jeff Young 2024-08-18 13:01:24 -06:00
parent 01332a2cb5
commit e6a5669d02

View File

@ -761,9 +761,12 @@ int PCB_POINT_EDITOR::movePoint( const TOOL_EVENT& aEvent )
if( !m_editPoints || !m_editPoints->GetParent() || !HasPoint() )
return 0;
BOARD_COMMIT commit( frame() );
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
BOARD_COMMIT commit( editFrame );
commit.Stage( m_editPoints->GetParent(), CHT_MODIFY );
VECTOR2I pt = editFrame->GetOriginTransforms().ToDisplayAbs( m_editedPoint->GetPosition() );
wxString title;
wxString msg;
@ -778,11 +781,12 @@ int PCB_POINT_EDITOR::movePoint( const TOOL_EVENT& aEvent )
msg = _( "Move Corner" );
}
WX_PT_ENTRY_DIALOG dlg( frame(), title, _( "X:" ), _( "Y:" ), m_editedPoint->GetPosition() );
WX_PT_ENTRY_DIALOG dlg( editFrame, title, _( "X:" ), _( "Y:" ), pt );
if( dlg.ShowModal() == wxID_OK )
{
m_editedPoint->SetPosition( dlg.GetValue() );
pt = editFrame->GetOriginTransforms().FromDisplayAbs( dlg.GetValue() );
m_editedPoint->SetPosition( pt );
updateItem( &commit );
commit.Push( msg );
}