From 0fde53622331d2814e591e2b9f0dd1978e2102b1 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 7 Mar 2021 14:53:27 +0000 Subject: [PATCH] Adjust zones when moving footprint origin. Fixes https://gitlab.com/kicad/code/kicad/issues/7825 --- pcbnew/footprint.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 114144e1b4..d40d28745e 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -1514,18 +1514,18 @@ void FOOTPRINT::MoveAnchorPosition( const wxPoint& aMoveVector ) switch( item->Type() ) { case PCB_FP_SHAPE_T: - { + { FP_SHAPE* shape = static_cast( item ); - shape->Move( moveVector ); - } + shape->Move( moveVector ); + } break; case PCB_FP_TEXT_T: - { + { FP_TEXT* text = static_cast( item ); text->SetPos0( text->GetPos0() + moveVector ); text->SetDrawCoord(); - } + } break; default: @@ -1533,6 +1533,12 @@ void FOOTPRINT::MoveAnchorPosition( const wxPoint& aMoveVector ) } } + // Update the keepout zones + for( ZONE* zone : Zones() ) + { + zone->Move( moveVector ); + } + m_cachedBoundingBox.Move( moveVector ); m_cachedVisibleBBox.Move( moveVector ); m_cachedTextExcludedBBox.Move( moveVector );