diff --git a/pcbnew/class_module_transform_functions.cpp b/pcbnew/class_module_transform_functions.cpp index dd04878340..171afdfbe1 100644 --- a/pcbnew/class_module_transform_functions.cpp +++ b/pcbnew/class_module_transform_functions.cpp @@ -283,8 +283,8 @@ void MODULE::SetPosition( const wxPoint& newpos ) wxPoint delta = newpos - m_Pos; m_Pos += delta; - m_Reference->m_Pos += delta; - m_Value->m_Pos += delta; + m_Reference->SetPosition( m_Reference->GetPosition() + delta ); + m_Value->SetPosition( m_Value->GetPosition() + delta ); for( D_PAD* pad = m_Pads; pad; pad = pad->Next() ) { diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp index 540be1f5cb..bab2d056a9 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp @@ -480,6 +480,10 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event ) m_CurrentModule->Draw( m_Parent->GetCanvas(), m_DC, GR_XOR ); } + // Init Fields (should be first, because they can be moved or/and flipped later): + m_CurrentModule->m_Reference->Copy( m_ReferenceCopy ); + m_CurrentModule->m_Value->Copy( m_ValueCopy ); + // Initialize masks clearances m_CurrentModule->SetLocalClearance( ReturnValueFromTextCtrl( *m_NetClearanceValueCtrl, m_Parent->GetInternalUnits() ) ); @@ -549,10 +553,6 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event ) m_CurrentModule->m_CntRot90 = m_CostRot90Ctrl->GetValue(); m_CurrentModule->m_CntRot180 = m_CostRot180Ctrl->GetValue(); - // Init Fields: - m_CurrentModule->m_Reference->Copy( m_ReferenceCopy ); - m_CurrentModule->m_Value->Copy( m_ValueCopy ); - /* Now, set orientation. must be made after others changes, * because rotation changes fields positions on board according to the new orientation * (relative positions are not modified)