Fix IPC API losing custom fields when updating footprints

This commit is contained in:
Lenny Khazan
2026-01-06 02:55:28 +00:00
committed by Jon Evans
parent 7ca1dca60c
commit 0596455809
2 changed files with 24 additions and 0 deletions
+11
View File
@@ -30,6 +30,7 @@
#include <pcb_reference_image.h>
#include <pcb_shape.h>
#include <pcb_track.h>
#include <pcb_field.h>
#include <pcb_text.h>
#include <pcb_textbox.h>
#include <zone.h>
@@ -60,6 +61,16 @@ std::unique_ptr<BOARD_ITEM> CreateItemForType( KICAD_T aType, BOARD_ITEM_CONTAIN
return std::make_unique<PAD>( footprint );
}
case PCB_FIELD_T:
{
FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( aContainer );
if( !footprint )
return nullptr;
return std::make_unique<PCB_FIELD>( footprint, FIELD_T::USER );
}
case PCB_FOOTPRINT_T:
{
BOARD* board = dynamic_cast<BOARD*>( aContainer );
+13
View File
@@ -536,6 +536,19 @@
)
)
)
(property "CustomField" "CustomValue"
(at 0 0 0)
(unlocked yes)
(layer "F.Fab")
(hide yes)
(uuid "212d694f-e13b-46df-9a52-6773137fcf6d")
(effects
(font
(size 1 1)
(thickness 0.15)
)
)
)
(attr through_hole)
(fp_line
(start -5.08 3.81)