177 Commits

Author SHA1 Message Date
Seth Hillbrand
bbc762a546 ADDED: Angle preview for polygon mod
Shows angle for the current and adjacent corners and whether they are
congruent
2025-08-31 11:49:41 -07:00
Jeff Young
a2e98fb53c Don't set point to a value we're not going to keep.
It just causes flicker.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19947
2025-08-31 17:13:11 +01:00
Seth Hillbrand
8c6f057f6c Re-organize points to allow missing radius
Not all rectangles want/need the radius point, but we will only be able
to drag one point at a time.  So we re-organize which point of an
overlapping set is selected

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21605
2025-08-31 07:10:14 -07:00
Seth Hillbrand
e3b550dd13 Add a little radius helper
When rounding a rectangle, add a helper that shows the current radius
2025-08-30 08:19:35 -07:00
Seth Hillbrand
8acf5c1a25 ADDED: Rounded Rectangles
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4742
2025-08-29 17:37:30 -07:00
Jeff Young
83fab7b02c Fix undo for move of group-of-shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21563
2025-08-28 13:20:14 +01:00
Seth Hillbrand
7841476ed6 Make all 4 corners draggable
When scaling, maybe you want to drag from the bottom left or top right

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21554
2025-08-25 22:02:20 -07:00
Seth Hillbrand
a034c30563 Properly add group size mod to commit
Allows escaping the current state

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21553
2025-08-25 21:59:13 -07:00
Seth Hillbrand
206dfa2883 Allow scaling grouped graphics in pcbnew
Adds scaling handles and editpoints to drag shapes larger/smaller while
maintaining proportions.  Future additions might include non
proportional scaling

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13072
2025-08-22 20:04:38 -07:00
Jeff Young
b0945ee697 Don't push someone else's commit. 2025-08-20 13:19:37 +01:00
Seth Hillbrand
1166cacc64 Snap point editor into place
Adds 90° support to the point editor and ensures editing is the same as
creating when it comes to point snapping

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21481
2025-08-15 12:19:06 -07:00
John Beard
cef8e77eed Revert "Pcbnew point editor: avoid flickering when dragging"
This doesn't work properly as EDIT_CONSTRAINTs are using
references to the wrong point.

This reverts commit f632bad5768420776bd639303c0ecd2bf591cc28.
2025-08-04 00:25:25 +08:00
John Beard
f632bad576 Pcbnew point editor: avoid flickering when dragging
Only apply the update point to the EDIT_POINT if it will actually
change. Otherwise the intermediate position before grid snapping, etc.,
caused flickering when dragging with a large grid.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19947
2025-08-04 00:03:07 +08:00
Jeff Young
55097b9539 Formatting. 2025-08-03 12:51:34 +01:00
Jeff Young
e0351b60b2 No point-editor support for rotated tablecells. (KICAD-RN8) 2025-07-08 18:05:34 +01:00
Jeff Young
116bd924c2 Static cast safety.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20958
2025-06-08 23:21:02 +01:00
Jeff Young
e8e7282fe1 Fix a bunch more bugs in bezier approximation. 2025-05-26 18:12:43 +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
John Beard
a116f5cd57 Point editors: move cycle arc mode to common action, add to menu
This isn't the best possible UX (having the various modes immediately
available as graphical affordances would be best). But it's somewhat
discoverable, and at least shows the hotkey, if any, and it in the
context menu and not hidden in a toolbar right click menu. So if the
affordance-type system doesn't make it for v10, this will at least
provide something in eeschema.
2025-05-02 21:30:33 +08:00
John Beard
01b29c12e0 Point editor: move arc editing behaviour to common code 2025-05-02 20:50:40 +08:00
John Beard
ff31b88857 Pcbnew: add keep-radius arc-edit mode
This is (now) fairly easy to slot into the PCB point editor
framework.

In this mode, the endpoints adjust only the endpoints on the existing
radius. Radius can ve changed with the midpoint point. The center
point moves the arc, as in the "keep center/adjust radius and angle"
mode.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15661
2025-05-01 22:07:46 +08:00
Jeff Young
60364a9062 Performance improvements for hatched fills (round 2)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20570
2025-04-08 17:35:35 +01:00
jean-pierre charras
f8ec23db00 WX_PT_ENTRY_DIALOG: enhancements: fix min size and add reset button.
It is used to enter a point position and a grid origin.
The new button (only in grid origin dialog) allows reset the position.
2025-04-03 13:19:20 +02:00
Mike Williams
40058ebe80 actions: move all basic selection operations to common actions 2025-04-02 12:02:01 -04:00
Jeff Young
3f15b0d75b ADDED: hatched fills for shapes. 2025-02-24 11:08:29 +00:00
John Beard
6423571349 Account for origin transforms in WX_PT_ENTRY_DIALOG
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19673
2025-01-19 00:08:20 +08: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
2926db778c Bug fixes for rotated tables. 2024-12-16 13:26:48 +00:00
Jon Evans
82fc1408e2 Fix a few issues with recent commits 2024-12-03 18:07:23 -05:00
Jon Evans
81b1200747 Fix computing anchors for dragged duplicated items
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18995
2024-12-02 16:06:49 -05:00
Jon Evans
bf8a3c8afc CHANGED: Make polygon point editing UX more intuitive
Polygon segment dragging no longer pays attention to the
H/V/45 global setting, and now always enforces a drag normal
to the original segment.  Polygon vertex editing no longer
enforces a H/V/45 constraint, instead relying on the grid and
object snap.
2024-12-02 12:04:42 -05:00
Jon Evans
49813dabd4 Set a more reasonable default chamfer size for small segments 2024-12-02 11:33:47 -05:00
John Beard
0896367753 Pcbnew: only show point editor chamfer where useful
The chamfer corner action is only meaningful for polygons
and zones, so only enable it there.

Also move some static logic out of of the interface
of PCB_POINT_EDITOR and use SELECTION_CONDITIONS
like other similar code.
2024-11-28 20:18:00 +08:00
Jeff Young
ee8d86390e Don't clone items when you want a duplicate.
Clone doesn't handle UUIDs or group membership.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18874
2024-11-18 21:49:36 +00:00
Jon Evans
5d7942a45f PCB_POINT_EDITOR: support padstacks 2024-11-06 20:38:01 -05:00
John Beard
87cd0a74f2 Point editor: unify segment, circle, bezier and tablecells (partial)
For segment, circle, beziers, these are the same in all editors and only
need access to the EDA_SHAPE nature, so we can remove the duplication
entirely.

For TABLECELLs, while the cells are polymorphic in that PCB and SCH
cells are both EDA_SHAPEs (via the TEXTBOXes), the parent TABLES
are not polymorphic, and thus the implementation can't be trivially
de-duplicated. Rather than do something with templates, just keep
it simple for now and maybe look at unifying tables later on.
2024-11-04 20:41:15 +08:00
John Beard
970d9b3615 Eeschema: point editor: edit polygons as on PCB
This includes edge dragging which is useful for rule areas.
2024-11-03 17:15:18 +08:00
John Beard
fe57c531e2 Eeschema: point editor: as a behavior class for SCH_LINEs
This adds the concept of editing _other_ items to the one
that informs the POINT_EDIT_BEHAVIOR - in this case connected
lines. This is one of the motivations behind this system,
as it will allow to bring similar logic to Pcbnew.
2024-11-03 06:00:39 +08:00
John Beard
cd8ae3afd1 Pcbnew: point editor: minor tidy ups now everything is a behavior 2024-11-03 06:00:39 +08:00
John Beard
1e587b15ae Pcbnew: point editor: use a behavior class for textboxes
Saving the best for last - the one that wound me up enough to
start this process - textboxes, which sometimes, but not always
behave like rectangles.

Rather than some exciting multiple inheritance of
RECTANGLE_POINT_EDIT_BEHAVIOR and a hypothetical rotated
rectangle behavior, delegate the rectangular behavior to
static helpers in the rectangle one.

They still can't be edited when rotated, but at least now there
is some hope that it's tractable!
2024-11-03 06:00:39 +08:00
John Beard
c66caf3e11 Pcbnew: point editor: move dimensions to a behavior class
Especially the aligned dims are fiddly, but all the
dimensions need the array size to be carefully kept
controlled, which is now part of the invariant of
each behavior.
2024-11-03 06:00:39 +08:00
John Beard
90e49a42e7 Pcbnew: point editor: use behavior class for generators
This also changes the interface on the GENERATOR classes
to no longer take a shared_ptr - these methods are synchronous
and don't store (shared) ownership of the EDIT_POINTs.
2024-11-03 06:00:39 +08:00
John Beard
d12ad6820b Pcbnew: point editor: move pads to a behavior class
Hopefully, this will make the extra logic for padstacks
more localised, rather than splitting it up throughout
PCB_POINT_EDITOR.
2024-11-03 06:00:39 +08:00
John Beard
dd7d90089d Pcbnew: point editor: zones use a behavior class
Mostly defers to the same logic as for polygons.
2024-11-03 06:00:39 +08:00
John Beard
268d7854e0 Pcbnew: point editor: tablecells use a behavior class 2024-11-03 06:00:39 +08:00
John Beard
736c955a21 Pcbnew: point editor: move reference image to a behavior class
This is a fiddly one that is good to encapsulate.
2024-11-03 06:00:39 +08:00
John Beard
5a6af05759 Pcbnew: point editor: move bezier to a behavior 2024-11-03 06:00:39 +08:00
John Beard
97e59b773f Pcbnew: point editor: move polygons to a behaviour class
There's a slight flicker when a polygon is edited, but
that was there before.
2024-11-03 06:00:39 +08:00
John Beard
4f840599b5 Pcbnew: point editor: use behavior for circles
This is a pretty straightforward one
(though there was a latent bug here because both CIRCLE
and ARC used CIRC_CENTER for the constrainer. If an ARC
and CIRCLE center were not the same index (and nothing says they
have to be) that could be wrong or crash.
2024-11-03 06:00:39 +08:00
John Beard
f1f011e49d Pcbnew: point editor: move arcs to a behaviour class
This is a good example of an edit behaviour that had a lot
of code in PCB_POINT_EDITOR that was only used for a single
item type. Many of these (now static) functions will probably
find use in other places arcs crop up like filleted shapes
and also in eeschema.

But for now, keep it simpler and keep them near where they
are used.
2024-11-03 06:00:39 +08:00