Offset 3D models when moving footprint origin.

Fixes https://gitlab.com/kicad/code/kicad/issues/7868
This commit is contained in:
Jeff Young 2021-03-12 17:37:09 +00:00
parent faf9cca938
commit 93db7a130a
2 changed files with 8 additions and 1 deletions

View File

@ -1539,6 +1539,13 @@ void FOOTPRINT::MoveAnchorPosition( const wxPoint& aMoveVector )
zone->Move( moveVector ); zone->Move( moveVector );
} }
// Update the 3D models
for( FP_3DMODEL& model : Models() )
{
model.m_Offset.x += Iu2Millimeter( moveVector.x );
model.m_Offset.y -= Iu2Millimeter( moveVector.y );
}
m_cachedBoundingBox.Move( moveVector ); m_cachedBoundingBox.Move( moveVector );
m_cachedVisibleBBox.Move( moveVector ); m_cachedVisibleBBox.Move( moveVector );
m_cachedTextExcludedBBox.Move( moveVector ); m_cachedTextExcludedBBox.Move( moveVector );

View File

@ -1209,7 +1209,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
return 0; return 0;
SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::ANCHOR ); SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::ANCHOR );
PCB_GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() ); PCB_GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() );
std::string tool = aEvent.GetCommandStr().get(); std::string tool = aEvent.GetCommandStr().get();
m_frame->PushTool( tool ); m_frame->PushTool( tool );