Removing the item from the board will also remove it
from any parent group, which then wasn't getting
restored. This makes it more clear that we need to
remove and then re-add.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18017
Required for net inspector otherwise composite operations (such
as undo / redo, and length tuning) can result in multiple add /
remove events firing which results in inconsistent length state.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17527
(for 9.0)
We only allow a certain number of commands on the lists
and trim them when they overflow. PCB_BASE_EDIT_FRAME and
PL_EDITOR_FRAME implemented this correctly; SCH_EDIT_FRAME
and SYMBOL_EDIT_FRAME did not.
The hack assumed that the parent group would be the first
deleted item of type group in the undo list. While this
will be true when undoing a user ungroup command, it will
not be when undoing an ungroup side-effect, such as when a
member of a group is deleted during UpdateFromPCB.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16384
Note that this only works where a BOARD_COMMIT or SCHEMATIC_COMMIT is used.
(BOARD_COMMIT is used almost universally in PCBNew, but SCHEMATIC_COMMIT
has very little adoption in EEschema so far.)
The undo will remove/re-add items to the view in order to update the
RTree. However, if we only clear caches at the end (in the OnModify
call), then the (stale) bbox caches are still used for the re-add
operation, and they end up at the wrong place in the RTree.
Fixes https://gitlab.com/kicad/code/kicad/issues/13048
Also adds some debugging to try to catch dangling pointers.
Also adds a cache for group bounding boxes (which will be expensive
to calculate for large groups).
Fixes https://gitlab.com/kicad/code/kicad/issues/12875
1) Don't remove items from group when the group is being deleted as
well. We need those pointers for undo/redo.
2) Flip the GROUP/UNGROUP undo status when undoing/redoing group and
ungroup actions.
3) Remove PCB_GROUP_T from the rebuild-netlists section. Nothing
about an item's group/ungrouped status changes its netlisting.
4) Add PCB_PAD_T to the rebuild-netlists section. It can probably
only happen in the footprint editor where we don't care about
netlisting, but it's conceptually more correct and who knows what
might change in the future....
Fixes https://gitlab.com/kicad/code/kicad/issues/7540