diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index b5172aaddc..9e165e8674 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -245,6 +245,28 @@ void PCB_BASE_FRAME::AddFootprintToBoard( FOOTPRINT* aFootprint ) // Place it in orientation 0 even if it is not saved with orientation 0 in lib (note that // it might be stored in another orientation if the lib is an archive built from a board) aFootprint->SetOrientation( ANGLE_0 ); + + EDA_UNITS units = GetUserUnits(); + + INSPECTOR_FUNC inspector = + [units]( EDA_ITEM* aItem, void* aTestData ) + { + PCB_DIMENSION_BASE* dimension = static_cast( aItem ); + + if( dimension->GetUnitsMode() == DIM_UNITS_MODE::AUTOMATIC ) + { + dimension->SetUnits( units ); + dimension->Update(); + } + + return INSPECT_RESULT::CONTINUE; + }; + + aFootprint->Visit( inspector, nullptr, { PCB_FP_DIM_ALIGNED_T, + PCB_FP_DIM_LEADER_T, + PCB_FP_DIM_ORTHOGONAL_T, + PCB_FP_DIM_CENTER_T, + PCB_FP_DIM_RADIAL_T } ); } } diff --git a/pcbnew/tools/pcb_control.cpp b/pcbnew/tools/pcb_control.cpp index 5eed3e35dc..2cea7976b6 100644 --- a/pcbnew/tools/pcb_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -1113,7 +1113,10 @@ int PCB_CONTROL::placeBoardItems( std::vector& aItems, bool aIsNew, { // Dimensions need to have their units updated if they are automatic if( dimension->GetUnitsMode() == DIM_UNITS_MODE::AUTOMATIC ) + { dimension->SetUnits( frame()->GetUserUnits() ); + dimension->Update(); + } }; for( BOARD_ITEM* item : aItems )