764 Commits

Author SHA1 Message Date
Jeff Young
3424f2bd4c Fix presumptive cast (KICAD-J24). 2025-06-26 19:42:14 -06:00
Jeff Young
100260ed59 Don't be pedantic about selection contents when exposing commands.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21112
2025-06-23 16:01:24 -06:00
jean-pierre charras
b621e0ccf5 Pcbnew: fix position of rectangles after a Rotate command. 2025-06-15 16:48:19 +02:00
Jeff Young
7fbf51b17c Be more pedantic about RECURSE_MODE.
Also fixes an invalid iterator bug.

Also adds mirroring support for PCB_GROUPs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21107
2025-06-12 11:21:28 +01:00
Jeff Young
31cf3f9b53 Nullptr safety. 2025-06-02 13:29:49 +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
Mike Williams
8ad9634498 pcb: add track change layer command
Works the same as the prev/next layer commands, but the addition of CTRL
brings the track with it.
2025-05-20 15:48:49 -04:00
Mike Williams
8ec70ee92b PCB: unroute segment
Works like the backspace key in the router, but for segments that are
already placed.
2025-05-19 14:05:14 -04:00
Jeff Young
ec6bc85a29 No requirement to UNGROUP when we're recording entire parent FP.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20589
2025-04-09 12:18:26 +01:00
Mike Williams
40058ebe80 actions: move all basic selection operations to common actions 2025-04-02 12:02:01 -04:00
Mike Williams
05e9772d54 groups: extract common class methods into EDA_GROUP base class 2025-04-01 14:34:20 -04: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
3c32f4d31d Refresh preview after rotate/flip/mirror during move.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19561
2025-03-14 13:17:52 +00:00
Jeff Young
e48a2b5ee4 Don't report non-meeting line-pairs.
We're called on each line pair, so a rect would otherwise
always report to failures for the two pairs of opposite
sides.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20326
2025-03-13 16:32:25 +00:00
Damjan
bded181ad0 pcbnew: table rotation: table jumps if rotation ends at 180° 2025-03-07 20:38:56 +00:00
Jeff Young
59d6152cf0 Cleanup stale comment. 2025-02-24 11:08:29 +00:00
Dmitry Rezvanov
663f00da25 Add "Route Selected From Other End" action to edit context menu 2025-02-19 18:12:04 +00:00
Ian McInerney
97b725fb42 Add Route Selected to the context menu
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19571
2025-02-09 23:00:26 +00:00
Roberto Fernandez Bautista
c5120b9090 Add fake-autoroute to context menus (router and edit) 2025-01-31 15:49:27 +01:00
John Beard
d55877ce27 Increment tool: use parent commit when appropriate, avoid double preview
Cloning the item into the previewe means that if we later increment
it, the preview clone doesn't update. Use the non-owning preview
interface to use the item directly in the preview.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19433
2025-01-15 00:26:09 +08:00
Alex Shvartzkop
129e37f63d Drag footprints only in non-hover selections. 2025-01-10 21:14:13 +05: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
Ian McInerney
d5c5050d29 Fix initialization order of the events in pcbnew
The TOOL_EVENT constructor searches for ACTONS::cancelInteractive. That
action is global, so we need to ensure it is created before we try to
create these events - so switch to a create on first use paradigm for
the events.
2024-12-31 00:18:10 +00:00
Jeff Young
97439d2cf6 Handle group duplicate in footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19245
2024-12-06 18:24:26 +00:00
Jeff Young
9c338c12c7 Typos. 2024-12-06 18:24:26 +00:00
Jeff Young
bb533f3f4a Fix multiple-footprint drag.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19101
2024-12-02 12:43:57 +00:00
John Beard
c39573ace3 Pcbnew: get footprint by name doesn't have to be a member on PCB_BASE_FRAME
This function doesn't access anything private to PCB_BASE_FRAME. So
split it into a static and slim the PCB_BASE_FRAME API just a
smidgen.
2024-11-01 20:35:50 +08:00
John Beard
c956e6761b Pcbnew: add interative relative offset tool 2024-10-30 09:00:14 +08:00
John Beard
2391e5ecdc Pcbnew array: allow selecting the center point interactively
This involves recasting the array tool from the slightly
eccentric ARRAY_CREATOR class into a full-blown TOOL, which
allows it to usefuly store state asd the dialog hides. This
is modelled on the POSITION_RELATIVE_TOOL strategy.

The by-radius-and-point mechanism is removed entirely,
as it's very fiddly and hard to describe in the UI,
and what you probably really want to do is get your
item onto the circle with tools like "move exact",
and then define the circle origin (now using the picker
tool)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16783
2024-10-28 22:01:14 +08:00
Jon Evans
673bb2f152 Fix fallthrough warning 2024-10-26 22:10:50 -04:00
John Beard
5545dfd02b Incrementing: add some types to selection filters 2024-10-26 17:56:32 +08:00
John Beard
2c2ff64911 Allow incrementing different parts of strings with modifiers
Primary increment is the right most bit, secondary is the next
rightmost. So you can increment 'A1' to 'A2' or 'B1' with
Shift-Alt-Scroll and Ctrl-Alt-Scroll respectively.
2024-10-26 16:01:07 +08:00
John Beard
9c9542deea Bind multiply-modified scroll events to the increment action
Implemented as handling un-consumed scroll events that the
WX_VIEW_CONTROLS doesn't want because it has too many mods
set. Then dispatch these as TA_MOUSE_WHEEL events.

The default action from the selection tools is to run the
'increment' ACTION, which is implemented differently in the
various tools: eeschema can increment labels, symedit
does pin names and numbers, and fpedit does pad numbers.
2024-10-26 16:00:58 +08:00
John Beard
3f602f8177 Add 'Increment' actions
These are context sensitive actions that increment "something"
about the selected item.

A generic 'increment' action can be produced, e.g. by other tools
or UI events, which has in increment step (positive or negative)
and an 'index' which determines what about the item should be
incremented - it's up to the increment action handler to decide
what that means.

And then add a primary and secondary inc/decrement action,
which allows to bind hotkeys to each.

Bind these to:

* Sym edit: increment pin names/number
            increment text items
* Sch edit: increment lables and text
* FP/PCB:   increment pin numbers
            increment text items
2024-10-26 15:46:16 +08:00
Denis Latyshev
260014710a Pcbnew: Add differential and single line length/skew mirroring
ADDED: Added functionality for mirroring differential and single line length, as well as skew adjustment elements.

Fixes https://gitlab.com/kicad/code/kicad/issues/18469
2024-10-16 19:21:03 +00:00
Jeff Young
a9f79093be Don't ask about locking twice.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18679
2024-10-14 10:59:14 +01:00
John Beard
c799966774 Handle pasting of image data from the clipboard
Also move some clipboard functions out of TOOL_MANAGER,
as they had no dependency on that class, and are just free
functions around wxTheClipboard.
2024-10-13 20:47:45 +08:00
John Beard
b0043587c2 Add 'Copy as Text' action
This is useful when you want to copy text content out to some
external program (or put it in a text item/box).

I'm not sure it's possible to intuit exactly what a user wants,
as you will often want to copy items as the real items, and sometimes
as text. While KiCad might be able to make a smart guess, external
programs will have no chance!
2024-10-13 20:47:45 +08:00
Andrzej Wolski
537d3ac81a ADDED: Soldermask layer option for tracks
Allows adding a soldermask opening for individual tracks.
Soldermask expansion can also be specified.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2125
2024-10-08 02:48:33 +00:00
Jon Evans
2a605e4a4e Infrastructure and file format for via stacks 2024-10-06 18:45:25 -04:00
Jon Evans
56e0811516 Phase 2 of padstack support
CHANGED: PCB file format now supports saving/loading complex padstacks

CHANGED: PTH pads are now rendered per copper layer in the copper color;
         the PTH pad color is no longer used.

ADDED: support for importing complex pad stacks from Altium PCBs

Enforce padstack-aware access to pad properties across KiCad

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8182
2024-10-01 19:55:03 -04:00
jean-pierre charras
016b9deec2 Pcbnew: better fix than commit 50d5c6a4 2024-09-28 15:57:46 +02:00
jean-pierre charras
50d5c6a437 Pcbnew, Flip rectangle shape: Keep its anchor position after flipping.
Previously, it was flipped using the shape anchor position. But for this
shape, the anchor (top left corner)) is reinitialized after flipping, so
flipping twice moves the shape.
Now the rectangle center is used as reference position to flip the shape

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18797
2024-09-28 10:14:25 +02:00
Seth Hillbrand
532dd0d4d9 Remove extra char 2024-09-27 12:19:18 -07:00
John Beard
215533f31a Unify flip direction handling
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).

Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.

This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
2024-09-27 17:13:13 +01:00
John Beard
95beedb612 Dogbones: add slots for acute angles
It's actually not as hard as I thought, though
surely has wierd edge cases which users might need to
handle manually.
2024-09-22 13:45:19 +01:00
John Beard
8609632fc4 Polygon operations: fix merging of disjoint shapes
Don't enforce that every merge result has to be
non-disjoint. Sometimes it will merge in the end
when gaps are filled in by other shapes. Even if
not, at the end, just create a new polygon for
each disjoint polygon.
2024-09-19 23:14:42 +01:00
John Beard
8fdb6d6e88 Feature: Exact item offset tool
This is a little bit like the bounding hull tool, but the
output is "exact" and it only supports the most common
source items.

By 'exact', this means that rounded corners are real arc
segments rather than polygonal approximations. Obviously,
this is rather tricky in the general case, and especially
for any concave shape or anything with a bezier in it.

Envisioned main uses:

* Creating courtyard and silkscreen offsets in footprints
* Making slots around line or arcs.

The one thing that it does not currently do, but which it might
plausibly do without reimplementing Clipper is convex polygons,
which would bring trapezoidal pad outsets for free. But that
is a stretch goal, and bounding hull can be used.
2024-09-19 06:35:43 +01:00
John Beard
4676baf46f Pcbnew snaps: honour the active layer selection when picking points
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18687
2024-09-11 22:36:11 +01:00