(It's still leaking into BOARD_COMMIT and some other places, but at
least it no longer leaks into all the edit tools.)
Also fixes some bugs when moving/copying/pasting multiple selections
containing length-tuning patterns.
The symbol editor has few enough items that it will still be performant
if we always send a selected-item-modifed event. (As it turns out we
were doing that anyway as the check for child-modified flags didn't
also check for selected.)
It had several encapsulation leakage issues, as well as poorly-defined
behaviour of undo for chained-actions (append-to-board, and then rotate
while moving, for instance).
Using a boolean argument just leads to a lot of trailing booleans in the
function calls and is not user friendly. Instead, introduce PostAction()
to send an action that runs after the coroutine (equivalent to passing
false or the default argument), and leave RunAction as the immediate
execution function.
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.)
Change teardrop generation to rely more heavily on BOARD_CONNECTIVITY
for improved performance.
Add updating of teardrops on BOARD_COMMIT::Push().
Also converts m_CopperItemRTreeCache to std::shared_ptr.
We don't copy it around anyway, and having to create a new set
of std::unique_ptr's for each operation is likely to be more
expensive than std::shared_ptr's overhead.
Provides a single-point access for modifying the schematic and symbol
elements that allows chaining updates and reverting partial changes.
Standardizes the undo hierarchy between pcb and schematic editors
As this is another layer on the existing undo/redo structure, the
initial commit does not replace all undo/redo calls currently existing.
These will be handled in a series of follow-on commits
In particular, record which children caused a parent footprint to be
added to the commit so we can determine if they have intersecting
bounding boxes and/or layers.
Fixes https://gitlab.com/kicad/code/kicad/issues/13512
We really don't want to post these events unless the *selected* items
were actually modified, since it results in a redraw of the properties
panel (which disturbs edit state and causes flicker on MSW).
Now the COMMIT system is responsible for sending this event iff the
commit touches items that are selected.
Side note: UpdateMsgPanel is useless on every app except pl_editor, so
it can probably be refactored/removed at some point.
We're going to re-add items to the view assuming they will have their
current locations, which requires the bounding boxes to be refreshed.
Fixes https://gitlab.com/kicad/code/kicad/issues/13084
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
In QA test, frame and selTool are nullptr.
So we cannot use wxCHECK( frame && selTool,...) because it breaks the QA test.
We just test frame and selTool when needed.