Commit Graph

2885 Commits

Author SHA1 Message Date
Jeff Young d161602e92 Don't snap a footprint (or group) to its children.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15535
2023-08-29 13:05:08 +01:00
Ian McInerney ba22347904 Move pcb_actions to new constructor 2023-08-29 00:19:19 +01:00
Jeff Young 0d39cd5e63 Allow for offset custom-shaped pads with no holes. 2023-08-28 18:07:18 +01:00
Jeff Young a470cab7b2 Include description for page settings command. 2023-08-27 19:03:17 +01:00
Jeff Young 3f26b29aa2 Minor cleanup and removal of stale comments.
Also attempts to fix a focus-loss bug on GTK after zone dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13221
2023-08-27 10:53:03 +01:00
Jeff Young c48084bbbf Minor cleanup and removal of stale comments. 2023-08-27 10:53:03 +01:00
Jeff Young 4fefd95e0c Move grid definitions to Prefs and grid origin to a separate dlg.
Grid origin is document-wide, while grid definitions are app-wide.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2262
2023-08-26 13:32:24 +01:00
Jeff Young e0cf49e73c Fix previous fix for honouring pad offset.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15494
2023-08-25 13:05:19 +01:00
Mike Williams 2b78c20a62 PCB: add grid overrides to graphics/router/etc. 2023-08-24 13:58:22 -04:00
Jeff Young 300014177f Honour pad offset when creating custom pad anchors (and polygons).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15494
2023-08-24 17:30:22 +01:00
Mike Williams d9c2e0ab54 PCB: start of grid overrides
Only works for moves.
2023-08-24 10:29:09 -04:00
Mike Williams 0f781f328e GRID_HELPER: push code to parent class
Prep'ing for PCB grid overrides
2023-08-24 10:29:09 -04:00
Jeff Young a2627fec60 Don't snap to footprint-private items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15447
2023-08-19 21:03:05 +01:00
Jon Evans 1efd75ca79 ADDED: Multi-layer object snapping
Default hotkey Shift+S toggles on/off

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6266
2023-08-17 09:25:47 -04:00
Jeff Young c54d97170b Fix bone-headed copy/paste. 2023-08-15 23:28:19 +01:00
Jeff Young 750b92b17f Don't allow selection of footprint dimensions.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15418
2023-08-15 17:06:56 +01:00
Roberto Fernandez Bautista dbfb7880b5 Add IO_MGR::FindPluginTypeFromBoardPath (+QA tests) 2023-08-15 05:26:12 +03:00
Alex Shvartzkop 76e0d5981d Import system refactor for PCB plugins. 2023-08-15 05:26:12 +03:00
Alex Shvartzkop a0d96cea9f Rename Save -> SaveBoard, Load -> LoadBoard in PLUGIN. 2023-08-15 05:26:12 +03:00
Jeff Young 2a3c4d0a03 Fix switch stmt fall-through. 2023-08-14 20:38:17 +01:00
Jeff Young bd8857389a Add a bit of slop for text-shape hit-testing. 2023-08-14 18:08:14 +01:00
Marek Roszko 14a0fa435c ADDED: DRC JSON report 2023-08-13 14:59:10 -04:00
jean-pierre charras 7fe80abdff PCB_GRID_HELPER::BestSnapAnchor() fix overflow due to use of int.
GRID_HELPER::GetVisibleGrid() needs double, does not work with int (overflow).
Fixes #15389
https://gitlab.com/kicad/code/kicad/-/issues/15389
2023-08-11 17:59:24 +02:00
Jon Evans a77e630901 ADDED: Connectivity for graphic shapes on copper layers
Graphic shapes (excluding text) can now have nets when on
copper layers. Shapes behave like tracks in that they will
pick up nets from connected pads, and follow track opacity
settings.
2023-08-10 21:47:43 -04:00
Marek Roszko 812143ac69 ADDED: Run PCB DRC via cli 2023-08-10 20:20:40 -04:00
Mike Williams 30eae5d896 Fields: preserve field order across sch<->pcb 2023-08-07 09:29:13 -04:00
Jeff Young 0413270012 ADDED: Move Corner To... and Move Midpoint To...
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5012
2023-08-05 16:43:55 +01:00
Jeff Young c697a934b2 Update layer names to current terminology.
Also fixes some out-of-date tooltips/names.
2023-08-04 11:37:46 +01:00
Seth Hillbrand 7fac72a914 Only deselect existing footprint if currently selected
If we have a footprint currently selected and we click on its empty
space again, we deselect the footprint.  However, if we click on the
empty space of a different footprint, we will select that footprint
instead.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15284
2023-08-03 11:17:31 -07:00
Seth Hillbrand a90c9d7c93 Refine the footprint selection logic
- Footprints cannot be selected if they do not have items visible on the
  screen
- Clicking on empty space in a footprint will select it if the space is
  contained in the visible bounding box
- Clicking on a selected footprint a second time will deselect it
- Clicking on a footprint that has pads selected will still select the
  footprint

This avoids having the full footprint bounding box considered when
selecting footprints (useful b/c footprint bbox is often much larger and
unexpected).  Also allows non-standard footprints (e.g. silk or fab only
footprints) to be logically selected if the layers on which they have
elements are visible.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15284
2023-08-03 10:03:15 -07:00
Jon Evans af58281a08 ADDED: Expand selection for graphics in PCB
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12032
2023-08-01 21:14:58 -04:00
Seth Hillbrand f3d65b5156 Revise method of selecting footprints in contrast
When working in high contrast mode, we want to be able to select a
footprint with only elements in, e.g. silk and fab layers.

The previous design for footprint IsOnLayer had one behavior of every
other element and a different behavior for footprints.  This leads to
multiple bugs as new features use the overloaded IsOnLayer expecting it
to report if the element exists on a layer or not.

For footprints, we need a different routine to determine whether or not
to select the footprint when clicking on it.  IsOnLayer will report if
the footprint has any elements on a specific layer but we don't want to
use the bbox for a hittest because large footprints with through hole
pads will exist on every layer and have an enormous bbox.  Instead, we
filter footprints based on the hittest of each element.  This behaves in
a more logical fashion, allowing you to select a footprint by clicking
on a visible element of that footprint.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15284
2023-08-01 10:43:13 -07:00
Mike Williams 744452d092 Sch/PCB: allow back-updating schematic fields from PCB
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15285
2023-07-31 10:38:43 -04:00
John Beard 478df24f36 Fix fillets and chamfers when the original lines become zero-length
This needs the ITEM_MODIFICATION_ROUTINE to learn to delete items.
Condense the item change handlers into a single injected object
(ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER) and provide the basic
implementation that just takes some callables.

This simplifies the construction of the routines and also would make
a CHANGE_HANDLER object possible that can be reused between different
tools.
2023-07-30 15:12:28 +01:00
John Beard da0daffa89 Remove more special-casing for fp-edit commit handling
In the EDIT_TOOL::ModifyLines method, there was some
remaining special-casing for FP childen commits.

One bit was put back by mistake (in
0b32ae3f4b) because I thought I'd
left it out of the refactor. In fact it was removed slightly later in
1218f61d0a.

THe other bit is omitting Modify commits in the FP-editor (what the
reinstatement of the above code was trying to cause). This shouldn't
be needed any more.

However, something is still incomplete here as the tools still don't
work correctly in the footprint editor. However, I don't think it's
substantially _more_ broken with the special casing removed and at
least it's less confusing.

Related to: https://gitlab.com/kicad/code/kicad/-/issues/15253
2023-07-30 15:10:30 +01:00
jean-pierre charras a16ab0aae1 Replace SHAPE_T::RECT by SHAPE_T::RECTANGLE: RECT creates a collision name
issue with a Windows header on msys2.
Change very similar to the commit 9a47b344 about class PAD_SHAPE.
No actual code change
2023-07-25 09:11:55 +02:00
John Beard 0b32ae3f4b Reinstate fp-editor-specific commit handling in fillet/chamfer tools
This check was omitted in the refactor of the fillet tool, and
resulted in a bug when undoing the action: the modified lines would
not be un-modified.
2023-07-23 14:48:31 +01:00
John Beard ab55684f0b ADDED: Add step parameter to footprint pad renumbering
Also includes persisting settings for next dialog invocation
and use the TransferDataFromWindow function rather than per-field
accessor methods.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10651
2023-07-16 15:37:12 +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
Ian McInerney ae60b57c3d Add default parameter to PCB image placement action 2023-07-13 13:15:19 +01:00
Ian McInerney e82a58a12e Changed: Allow filling/unfilling individual zones with no selection
The draft fill and single zone unfill would only work if something was
selected first, this allows them to call the selection operation to
request what is under the cursor. Also properly gate the operation to
not cause crashes/issues when the selection contains non-zone items.
2023-07-12 23:00:13 +01:00
Ian McInerney a8f628d0df Add virtual destructor for base class 2023-07-12 19:39:15 +01:00
John Beard 09c0f713cd Add fillet and chamfer icons 2023-07-12 19:21:47 +01:00
John Beard a72ab9f351 Put fillet, chamfer and extend in a submenu 2023-07-12 19:21:47 +01:00
John Beard 046d978ba7 ADDED: Pcbnew chamfer and extend tools
Using the new ITEM_MODIFICATION_ROUTINE system, drop in two new
tools: chamfer and line extend. These are two geometric operations
that are relatively common when editing footprints in particular.

Chamfer delegates the geometric calculations to a dedicated unit
in kimath/geometry.
2023-07-12 19:21:37 +01:00
John Beard 8e0e9ce752 Generalise fillet tool
Describe the actions of the fillet tools is a generic way, so that the
same general pattern can be used for other tools that modify shapes on
the BOARD.

Basically, an "ITEM_MODIFICATION_ROUTINE" is defined, which is
configured and called multiple times, calling back to the EDIT_TOOL when
it modifies or creates an item.

The motivation here is to make it easier to slot in new line-based
tools like chamfer, extend and so on without having to redo the
complicated item, selection and commit handling each time, and keep the
core "routines" simple and decoupled from the EDIT_TOOL's
internals.

This also resolves #15094 because the new commit handling does the right
thing when items were "conjured up" for the fillet (e.g. when a
rectangle is decomposed into lines).

Fixes: #15094
2023-07-12 19:21:26 +01:00
Jeff Young be63e1824e Create filled polygons when centerline is chosen. 2023-07-12 10:41:46 +01:00
Jeff Young c3d10084b9 ADDED footprint associations dialog. 2023-07-11 14:52:05 +01:00
Ian McInerney aab8d2b036 Give autocomplete routing a default parameter
Fixes KICAD-2M4
2023-07-10 19:41:03 +01:00