Commit Graph

156 Commits

Author SHA1 Message Date
Jeff Young a09a5cb641 More undo cleanup.
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.)
2023-07-16 14:43:29 +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 c3222b0652 Clear edit flags on footprint children in footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15199
2023-07-14 22:16:11 +01:00
Jeff Young d02e94805a Store original boardItem (before promoting ent.m_item to parent footprint). 2023-07-14 20:43:13 +01:00
Jeff Young cf8294b5c2 Remove a bunch of blind (and a few redundant) static_casts. 2023-07-13 14:14:45 +01:00
Jeff Young 67c9d3932b Another attempt to fix qa error. 2023-07-03 16:26:20 +01:00
Jeff Young 9ff33e5ec6 Remove BOARD_COMMIT( TOOL_MANAGER ).
It initializes both m_isFootprintEditor and m_isBoardEditor to false,
causing all sorts of trouble.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15072
2023-07-01 11:52:46 +01:00
Jeff Young 1411b09178 Remove EDIT_TOOL's quasi-global BOARD_COMMIT.
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).
2023-06-27 17:04:18 +01:00
Ian McInerney 2fb6f19a84 Separate immediate and delayed action dispatch
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.
2023-06-27 00:57:59 +01:00
Mike Williams 993bb84240 PCB_FIELD: bug fixes 2023-06-20 18:34:52 +00:00
Mike Williams 6d93950dcc PCB: abolish TEXT_TYPE::TEXT_is_*
PCB_TEXT is now always what was formerly TEXT_is_DIVERS and PCB_FIELDs
now what mandatory field type they are already.
2023-06-20 18:34:52 +00: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 ff9a5b8373 Remove change from teardrop merge that wasn't needed for final impl. 2023-05-21 16:39:18 +01:00
Jeff Young 8b1fd62d35 Make pad & via teardrops 1st-class citizens (props of the pad/via)
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.
2023-05-19 18:02:03 +01:00
Seth Hillbrand f4b43617e7 Add COMMIT structure to Schematic and Symbol editors
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
2023-04-28 17:05:47 -07:00
Jeff Young bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Wayne Stambaugh 789bf6455a Coverity fixes and code cleaning. 2023-03-02 09:04:47 -05:00
Jeff Young 0ff8ba1d8c Stage group children when staging group.
Many operations such as move, rotate, etc. are applied directly to the
group's children, so it's the children that need staging.

Fixes https://gitlab.com/kicad/code/kicad/issues/13999
2023-02-28 16:51:23 +00:00
Jon Evans f7d59f2e89 Enable properties panel in footprint editor 2023-02-17 20:35:56 -05:00
Jeff Young 40e1296a8b Clear dirty flags after a move.
Fixes https://gitlab.com/kicad/code/kicad/issues/11362
2023-02-15 14:50:31 +00:00
Jeff Young 509b39e9e4 Propagate nets within non-conflicting clusters immediately.
Fixes https://gitlab.com/kicad/code/kicad/issues/13601
2023-01-23 16:25:29 +00:00
Jeff Young ea4c3a267b Be more discerning about dirtying zones for auto-refill.
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
2023-01-13 19:09:22 +00:00
Jon Evans ee0a41e3bc Remove excess calls to SelectedItemsModified
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.
2022-12-26 20:57:58 -05:00
Jeff Young a7df573748 Clear bounding box caches *before* reverting commit.
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
2022-12-11 00:56:46 +00:00
Jeff Young 19eab62516 More safety around ratsnest state.
Fixes https://gitlab.com/kicad/code/kicad/issues/13011
2022-11-30 13:00:21 +00:00
Seth Hillbrand 259e41be2d Don't add non-groupable items to the group
Things like markers and netinfo should never get added to the group,
even if we are inside the group while adding the items

Fixes https://gitlab.com/kicad/code/kicad/issues/13026
2022-11-28 09:11:20 -08: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
jean-pierre charras 8d44c770a8 board_commit.cpp: Avoid generating a wxAssert message in QA test.
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.
2022-10-29 16:28:57 +02:00
Wayne Stambaugh 598b09821a Coverity fixes. 2022-10-17 15:30:20 -04:00
Jeff Young e49de68a59 Implement a more durable zone bounding box caching strategy.
Fixes https://gitlab.com/kicad/code/kicad/issues/10821
2022-10-01 22:10:43 +01:00
Jeff Young d67437a2aa Move ratsnest exclusion processing to a post-pass.
Also fixes a few cases where we were unnecessarily rebuilding
connectivity more than once for an operation.
2022-09-29 17:08:49 +01:00
Jeff Young c30a557810 ADDED netclass assignment from PCB canvas.
Fixes https://gitlab.com/kicad/code/kicad/issues/5975
2022-09-03 19:29:59 +01:00
Jeff Young 2dc6300501 Move EDA_ITEM bounding boxes to BOX2I. 2022-08-31 10:16:55 +01:00
Jeff Young 4bc7c16ce0 Don't auto-fill zones due to DRC marker insertion. 2022-08-01 13:09:51 +01:00
Jeff Young 661caf1de9 Make sure new zones are filled when auto-fill is on.
Also fixes some issues with enablement of the Remove Islands stuff.

Fixes https://gitlab.com/kicad/code/kicad/issues/12123
2022-08-01 13:09:51 +01:00
Jeff Young 1bad72f14f Remove bad static_cast.
(m_settings isn't a PCBNEW_SETTINGS in non-PCB_EDIT_FRAMEs)
2022-07-24 23:41:41 +01:00
Mike Williams 3669cb4673 PCB Editor: Add User Background Images 2022-07-14 11:23:23 +00:00
Jeff Young 43b82aeffc Fix another case of Edge_Cuts & Margins needing to be treated as all-physical-layers.
Fixes https://gitlab.com/kicad/code/kicad/issues/11843
2022-07-10 20:32:28 -06:00
Jeff Young 654740b90d Add newly-drawn objects to any entered group.
Fixes https://gitlab.com/kicad/code/kicad/issues/11912
2022-07-08 17:27:05 -06:00
Wayne Stambaugh 150859c973 Try Coverity fixes that don't break unit tests. 2022-03-25 16:49:29 -04:00
Wayne Stambaugh 7da7864f5e Fix some Coverity issues. 2022-03-25 15:51:05 -04:00
Jeff Young 6b806bbe9c Make sure Cleanup handles shapes other than segments.
Fixes https://gitlab.com/kicad/code/kicad/issues/10955
2022-03-02 18:28:39 +00: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 d465eb6425 ADDED: automatic zone refilling.
This is for the out-of-box experience for novice users.  It is presumed
that folks with larger more complicated boards will turn it off.

Fixes https://gitlab.com/kicad/code/kicad/issues/6413
2022-02-24 18:16:45 +00:00
Jeff Young 98b9c6e2a1 Better progress reporting and a slight performance boost on commit. 2022-02-15 12:20:34 +00:00
Jeff Young 5739505aa3 TextBoxes for PCBNew. 2022-01-31 20:00:47 +00:00
Jon Evans 4be56825bb Fix creating polygons from footprint rule areas
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10257

(cherry picked from commit e9b91b6fab)
2022-01-04 21:31:40 -05:00
Jeff Young 5e4a704155 Remove some more duplicated preferences.
Fixes https://gitlab.com/kicad/code/kicad/issues/10112
2021-12-26 13:37:28 +00:00