142 Commits

Author SHA1 Message Date
Jeff Young
e2808846ce Formatting. 2025-06-24 11:52:29 -06:00
jean-pierre charras
ea12df80be make board area colored (from Ethan Chien) 2025-06-19 18:26:39 +02:00
Jeff Young
e2cf944915 Dirty clearance lines when rule areas change.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20734
2025-06-13 16:37:10 +01:00
Jeff Young
52f9cba035 Add missing member variables to EDA_ITEM::operator=
Also don't rebiuld groups that are only on the undo list.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21064
2025-06-05 18:01:44 +01:00
Jeff Young
f58fc0b952 Rewrite GROUP undo based on uuids.
This also removes the GROUP/UNGROUP-specific undo actions.

This also fixes a bunch of undo bugs when duplicating
group members, creating pins, etc.

This also fixes some undo bugs when dividing wires etc.

This also fixes some bugs with new sch items not
being created within an entered group.
2025-05-21 14:24:59 +01:00
Jeff Young
0659290417 Simplify hatch damage/rebuild and move it out of view.
There should be far fewer hatched objects than other
objects, so we're spending too much effort finding
all the possible damage when we probably should
just be auto-regenerating all the hatching.

This also moves it out of being done during redraw,
which was proving problematic.  Plus the refill
zones architecture does it during commit, and has
a lot more miles behind it.
2025-04-07 11:46:02 +01:00
Mike Williams
05e9772d54 groups: extract common class methods into EDA_GROUP base class 2025-04-01 14:34:20 -04:00
Jeff Young
baaf341d0d Remove debug assert.
Yes, it does indeed fire (a lot, as Sentry can
tell us).
2025-03-29 21:24:08 +00:00
Mike Williams
a90b8ec57a pcb: merge RunOnChildren/Descendants into one function with a mode 2025-03-27 13:16:09 -04:00
JamesJCode
ede5faee72 Implement dynamic assignment of component classes 2025-03-15 14:33:47 +00:00
Jeff Young
7db3ccd98a Better algorithm for knocking out footprints.
(Though anything would have been as the previous
one didn't work at all.)
2025-02-24 23:01:07 +00:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Jeff Young
94f995c49e Reduce dependency on dynamic_cast.
(Especially where it is no-worky on MacOS.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17245
2024-09-04 17:24:49 +01:00
Jeff Young
7ca84091b6 Formatting. 2024-07-22 20:06:47 +01:00
Seth Hillbrand
cc850d0da0 Split out LSEQ/LSET from LAYER_ID
Separate the layer grouping classes for easier modification
2024-07-08 20:59:46 -07:00
Jeff Young
ea72beb2f7 Remove & then re-add undo items to parent group.
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
2024-05-17 19:34:21 +01:00
JamesJ
951065390e Add composite update callback to BOARD_LISTENER
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)
2024-04-04 22:29:47 +00:00
Jeff Young
491adc6c6c Formatting. 2024-03-29 16:04:32 +00:00
Jeff Young
2c21ef1ed0 Fix footprint undo for new UUID caches.
The footprint's children get swapped by the parent's std::swap
call, so they need to get removed/added to their parent around
the swap.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17592
2024-03-29 16:04:32 +00:00
JamesJ
f51e775f26 Use bulk BOARD_LISTENER calls following undo or redo operations
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17561
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17420
2024-03-24 19:25:26 +00:00
Seth Hillbrand
6a8d2a7eb3 Store group id rather than group
We only need the group storage id for lookup.  Storing the KIID instead
of a copy of the group avoids unneeded overhead

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17175

(cherry picked from commit 7d1adff07184d61b59aee9582f7fa0220b3604da)
2024-02-28 13:27:38 -08:00
Jon Evans
622c2f1316 Make sure connectivity is updated in undo/redo
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16945
2024-02-11 20:01:15 -05:00
Jeff Young
bce372c8a3 Don't clear the undo/redo list when we're just trimming it.
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.
2024-02-07 14:52:10 +00:00
Jeff Young
07cefa7883 More active tracking of undo/redo items. 2024-01-27 20:02:40 +00:00
Jeff Young
a8f6329590 Remove stale comment. 2024-01-27 15:52:59 +00:00
Jeff Young
68cbb820a7 performance efficiencies 2023-12-18 17:20:34 +00:00
Jeff Young
1b0cc82c56 Move a couple of stragglers to BOARD_COMMIT. 2023-12-17 21:01:31 +00:00
Jeff Young
b29a56530c Remove undo-of-ungroup hack.
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
2023-12-17 15:35:35 +00:00
Jeff Young
9fb06f95a0 Fix msys2 build. 2023-12-16 16:17:24 +00:00
Jeff Young
ea3c87f243 Move group/ungroup to COMMIT infrastructure. 2023-12-16 14:17:25 +00:00
Jeff Young
504652b972 Regularize RunOnChildren() at the BOARD_ITEM level.
BOARD_ITEM sub-classes which don't have children simply don't
overrid it.
2023-10-14 15:04:18 +01:00
Jeff Young
78ee6f2e42 Fix a couple of undo bugs.
The first caused items coming back from undo to be hidden.

The second caused them to be ungrouped from the parent meander.
2023-10-12 17:54:34 +01:00
Alex Shvartzkop
be72e07e61 Introduce PCB_GENERATOR. 2023-10-08 02:41:17 +00:00
Jeff Young
69a1b30b8a Implement undo/redo around Pad Edit Mode changes. 2023-09-01 18:48:46 +01:00
Jeff Young
1218f61d0a Implement undo/redo for footprint children.
Our special-cases to handle the fact that we didn't do this had far
outgrown the code necessary to actually handle it.
2023-07-15 17:37:31 +01:00
Jeff Young
cf8294b5c2 Remove a bunch of blind (and a few redundant) static_casts. 2023-07-13 14:14:45 +01:00
jean-pierre charras
7ac0ca9c14 Pcbnew, undo_redo: Do not cast to BOARD_ITEM items that are only EDA_ITEM
A BOARD_ITEM is derived from EDA_ITEM, so the cast is not possible
Fixes #15177
https://gitlab.com/kicad/code/kicad/-/issues/15177
2023-07-13 10:53:50 +02:00
Jeff Young
d5b5a3eaf4 Add action info to Undo/Redo menus.
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.)
2023-06-07 14:37:34 +01:00
Jeff Young
4a3f77cd9d Clear board soldermask when undoing/redoing items that affect it.
Fixes https://gitlab.com/kicad/code/kicad/issues/13446
2023-04-15 00:06:58 +01:00
Jeff Young
bba8a0826e Clear caches before undo operation.
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
2022-12-02 10:59:48 +00:00
Jeff Young
13f5c78e89 More tightening of group parent lifecycles.
Fixes https://gitlab.com/kicad/code/kicad/issues/12908
2022-11-16 00:42:38 +00:00
Jeff Young
03ba14c6d3 Tighten lifecycle management of parent group pointers.
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
2022-11-11 17:27:28 +00:00
Jeff Young
16d5c43c14 Fix shadowed variable. 2022-09-25 22:04:56 +01:00
Jeff Young
b4701593fb Restore parent group pointers on undo.
Fixes https://gitlab.com/kicad/code/kicad/issues/11914
2022-09-25 21:45:29 +01:00
Seth Hillbrand
fab78af176 Remove TEDIT
This marker is not used in KiCad and creates merge conflicts when two
different users edit the same file
2022-03-01 00:25:44 +00:00
Jeff Young
bc51c89c90 Reconcile zone-auto-fill with undo. 2022-02-25 13:05:49 +00:00
Jeff Young
7ccac79192 More wxString wide literals. 2022-02-05 21:29:34 +00:00
jean-pierre charras
30c001265b pcbnew, undo_redo.cpp: fix a logical bug that can hang in rare cases. 2021-09-08 13:06:55 +02:00
jean-pierre charras
6c7c9ca50c Fix compil warnings (UNDO_REDO::GROUP renamed to UNDO_REDO::REGROUP to fix
collision name with a widows header on msys2)
2021-08-28 11:44:01 +02:00
Wayne Stambaugh
cf00319c85 More NULL expunging. 2021-07-20 07:27:18 -04:00