Update local coords after changing footprint item properties.

Fixes https://gitlab.com/kicad/code/kicad/issues/14348
This commit is contained in:
Jeff Young 2023-03-27 16:42:45 +01:00
parent 0e82b79a8f
commit 0f9a4ef7b7
1 changed files with 18 additions and 0 deletions

View File

@ -30,8 +30,11 @@
#include <board_connected_item.h>
#include <properties/pg_properties.h>
#include <pcb_shape.h>
#include <fp_shape.h>
#include <pcb_text.h>
#include <fp_text.h>
#include <pcb_track.h>
#include <pad.h>
#include <settings/color_settings.h>
#include <string_utils.h>
@ -191,6 +194,20 @@ void PCB_PROPERTIES_PANEL::valueChanging( wxPropertyGridEvent& aEvent )
}
void setLocalCoord( BOARD_ITEM* aItem )
{
// TODO: we really need to get rid of this local/draw coords stuff (and make FP_* items the
// same as PCB_* items), but for now, it is what it is.
if( FP_SHAPE* shape = dynamic_cast<FP_SHAPE*>( aItem ) )
shape->SetLocalCoord();
else if( FP_TEXT* text = dynamic_cast<FP_TEXT*>( aItem ) )
text->SetLocalCoord();
else if( PAD* pad = dynamic_cast<PAD*>( aItem ) )
pad->SetLocalCoord();
}
void PCB_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent )
{
PCB_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
@ -207,6 +224,7 @@ void PCB_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent )
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( edaItem );
changes.Modify( item );
item->Set( property, newValue );
setLocalCoord( item );
}
changes.Push( _( "Change property" ) );