CADSTAR PCB: Ensure pads have correct position and footprints at 0,0
Fixes a display issue in the footprint preview where all the pads were displayed at 0,0
This commit is contained in:
parent
2cefabc99a
commit
5efec4cd51
|
@ -207,6 +207,9 @@ std::vector<std::unique_ptr<FOOTPRINT>> CADSTAR_PCB_ARCHIVE_LOADER::LoadLibrary(
|
||||||
delete m_board;
|
delete m_board;
|
||||||
|
|
||||||
m_board = new BOARD(); // dummy board for loading
|
m_board = new BOARD(); // dummy board for loading
|
||||||
|
m_project = nullptr;
|
||||||
|
m_designCenter = { 0, 0 }; // load footprints at 0,0
|
||||||
|
|
||||||
loadBoardStackup();
|
loadBoardStackup();
|
||||||
remapUnsureLayers();
|
remapUnsureLayers();
|
||||||
loadComponentLibrary();
|
loadComponentLibrary();
|
||||||
|
@ -791,6 +794,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponentLibrary()
|
||||||
loadLibraryCoppers( component, footprint ); // Load coppers after pads to ensure correct
|
loadLibraryCoppers( component, footprint ); // Load coppers after pads to ensure correct
|
||||||
// ordering of pads in footprint->Pads()
|
// ordering of pads in footprint->Pads()
|
||||||
|
|
||||||
|
footprint->SetPosition( { 0, 0 } ); // KiCad expects library footprints at 0,0
|
||||||
m_libraryMap.insert( std::make_pair( key, footprint ) );
|
m_libraryMap.insert( std::make_pair( key, footprint ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1271,6 +1275,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
|
||||||
RotatePoint( drillOffset, padOrientation );
|
RotatePoint( drillOffset, padOrientation );
|
||||||
pad->SetPos0( getKiCadPoint( aCadstarPad.Position ) - aParent->GetPosition() - padOffset
|
pad->SetPos0( getKiCadPoint( aCadstarPad.Position ) - aParent->GetPosition() - padOffset
|
||||||
- drillOffset );
|
- drillOffset );
|
||||||
|
pad->SetPosition( getKiCadPoint( aCadstarPad.Position ) - padOffset - drillOffset );
|
||||||
pad->SetOrientation( padOrientation + getAngle( csPadcode.SlotOrientation ) );
|
pad->SetOrientation( padOrientation + getAngle( csPadcode.SlotOrientation ) );
|
||||||
|
|
||||||
//TODO handle csPadcode.Reassigns when KiCad supports full padstacks
|
//TODO handle csPadcode.Reassigns when KiCad supports full padstacks
|
||||||
|
|
Loading…
Reference in New Issue