105 Commits

Author SHA1 Message Date
Jeff Young
755537ad8c Fix some std::move() of a reference parameter issues.
Also some coding standard fixes for member variable
names.
2025-07-27 13:55:16 +01:00
Jeff Young
c758a2fbaf Don't sequence layers when order doesn't matter. 2025-07-14 19:12:44 +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
46cb3f96a0 Stale pointer safety. 2025-06-08 22:10:39 +01:00
Jeff Young
a6707a42d1 Formatting. 2025-06-08 21:46:42 +01:00
aris-kimi
0cf866d4fb Inline static bool Fp/3Dmode members to remember panel layout
Layout is remembered for Schematic/Symbol Editors and Footprint Chooser frames until KiCad restarts

Also Added a new button toggle to show/hide the description panel with some new images too


Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17610
2025-05-20 16:16:01 -07:00
John Beard
e604ad9a3c Pcbnew: fix pad snaps on non-F.Cu in high constrast mode 2025-04-27 21:47:32 +08:00
Damjan
af11746cc4 pcbnew and eeschema: Table and textbox rotation / text justification fix 2025-04-21 13:32:46 +00:00
Damjan
c4ff42cb54 Adds dedicated anchor points for table
Allows snapping and easier alignment first tables



Fixes https://gitlab.com/kicad/code/kicad/-/issues/20184
2025-04-14 19:47:35 -07: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
John Beard
5b07bb4f6a Pcbnew: fix snapping to reference image anchor points
Otherwise it's impossible to accurately place an image
using a corner or origin.
2025-01-24 03:46:58 +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
a910eaf081 Hit-test pads before computing their anchors.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19238
2024-12-04 17:41:53 +00: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
John Beard
3162747d25 Pcbnew: include pad snaps for visible layers when not in high-constrast mode
This the 'activeLayers' is a more restricted set of layers than
all visible layers. When high constrast mode is off, snaps should
be available for all visible layers, not just layers in the
'activeLayers' set.

This is similar to the check done in checkVisibility, but as
pads are multi-layer items, they have this check afterwards as
well.

Note - the All Layer/Active Layer Only filtering is handled elsewhere.
2024-11-10 22:25:53 +08:00
John Beard
4846d07e47 Construction geometry: lighter on the stack
Pass things as unqiue_ptrs. I don't think there's that much
on the stack, but certainly addinig big enough chunks to the batches can
upset the coroutines.

Also reinstate a ClearDrawables which went AWOL.pick

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18835
2024-10-27 07:07:25 +08:00
John Beard
312996f0a2 Extension snaps: don't accept empty batches
These shouldn't be bad, and probably don't actually happen,
but they will act to clear extant construction lines for no
new shown items, so may as well be clear that they don't
do anything.
2024-10-05 23:08:15 +01:00
John Beard
9060292cd0 Snapping: call out hover accuracy explicitly
This is a place that could be tuned for usability.
2024-10-04 11:01:46 +01: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
John Beard
e23b83505e Snapping: delayed activation of snap points.
This makes it easier to control what snap points you are aiming for
without accidentally activating objects just by mousing near them
on the way to somewhere else.
2024-10-01 18:06:27 +01:00
John Beard
aea42a5cdf Pcbnew: handle connected copper circle points
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18774
2024-09-25 12:28:43 +01:00
Mike Williams
867cb58175 feature removal: remove Show Hidden Text
Does not work properly since 8.0 introduction of footprint fields.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18656
2024-09-19 15:41:44 -04:00
John Beard
1d2fb3ec82 Geom: add a simple OVAL type
Makes it easier to reason about oval shapes in geometric terms.

For now, this isn't a SHAPE, but it could be (and it's a
fairly common primitive, so it could be useful, though the
obvious use (clearance) is equivalent to a SEG with a clearance,
which is already a function that exists.
2024-09-19 06:35:43 +01:00
John Beard
e5aa82224d Pcbnew snaps: don't require activation when extension snaps not enabled
Can be removed when the extension snaps aren't ADVANCED_CFG.
2024-09-12 09:26:51 +01:00
John Beard
ebef24b6b0 Debug: graphical snap anchor debug mode
When working near snap anchors, which come and go
rapidly, it's often useful to see what snaps have been
calculated. Add an advanced config to show these
(EnableSnapAnchorsDebug) on an overlay layer.

With more polish this could be a hotkey or something.
2024-09-11 22:35:35 +01:00
John Beard
6bad4bb1a2 Put extension snaps behind an advanced config
This can be backed out when the snapping bevaviour is
considered good enough to be on by default.
2024-09-11 22:35:35 +01:00
John Beard
b2be0d39bd Snapping: Add construction geometry snapping
This is a pretty major rework of the snapping system.
The GRID_HELPERs now have a separate CONSTRUCTION_MANAGER
which handles some of the state involving "construction
geometry".

This is fed with 'extended' geometry (e.g. "infinite" lines from
segments) for use in generating things like intersection points.
It also handles adding this geoemtry to a GAL view item
(CONSTRUCTION_GEOM) for display to the user.

The process is:

* A TOOL creates a GRID_HELPER
* Optionally, it pre-loads a "persistent" batch of construction
  geometry (e.g. for an item's original position)
* The grid helper finds useful snap 'anchors' as before, including
  those involving the construction items.
* Other items on the board can be 'activated' by snapping to one
  of their main points. Then, if it has construction geometry,
  it will be added to the display. At most 2 items of this kind of
  geometry are shown, plus the original item, to reduce avoid
  too much clutter.

The dashed snap lines state machine is also handled in the
CONSTRUCTION_MANAGER and displayed in the CONSTRUCTION_GEOM item.
2024-09-11 22:35:35 +01:00
Seth Hillbrand
5e0abadb23 Reorganize layer numbering
F_Cu = 0
B_Cu = 2
Remaining internal copper layers are even and incrementing

Non-copper layers are odd and incrementing.

This means that we can no longer do things like:
for( PCB_LAYER_ID layer = F_Cu; layer <= B_Cu; ++layer)
Instead, we have the class LAYER_RANGE:
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu) )

Similarly, gt/lt tests should not refer to the integer value of the
layer.  We have functions such as IsCopperLayer to test whether a layer
is copper or not.

When using the connectivity RTree, the third dimension is layer, so we
provide B_Cu with the special INT_MAX value, ensuring that elements
between F_Cu and B_Cu will be identified.  There is a new, special
function GetBoardLayer() for interfacing with CN_ITEMS

Similarly, PNS layers remain unchanged and sequential.  A set of
interface functions is provided to map PNS layers to Board layers and
back.  This allows the PNS_LAYER_RANGE to function as expected
2024-09-06 23:07:58 +00:00
John Beard
1fb2d7fe26 Pcbnew: Snap to graphic/track intersections
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/2329
2024-08-28 13:49:36 +01:00
John Beard
6c5c9fe89a Add a center snap point to rectangles 2024-08-28 13:49:36 +01:00
John Beard
0818ee1770 Pcbnew/FPedit: Add snap anchor type indicators
This allows to see what the current snap point is, which is useful when
zoomed in, or the point is like the corner of a rounded pad where it's
"in free space" and might not be immediately obvious.
2024-08-28 13:49:36 +01:00
Seth Hillbrand
094d265313 Re-enable grid snap line
This was accidentally disabled by 4039b7da6b9095b14e50eed37d76d29cee5f4111
2024-08-08 14:29:27 -07:00
Jeff Young
32808b6cb7 Don't snap to anchors if they're turned off.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18158
2024-07-22 13:21:29 +01:00
Jeff Young
30be2d3fd5 Don't fetch anchors from invisible or dimmed layers. 2024-07-22 13:21:29 +01:00
Jeff Young
5686600192 Formatting. 2024-07-22 13:21:29 +01:00
Jeff Young
fcb104694b Avoid cover types. 2024-07-22 13:21:29 +01:00
Jeff Young
2925d63c44 Formatting. 2024-05-27 13:04:20 +01:00
Jon Evans
2f6c9d1f3a ADDED: Selection filter for schematic editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14988
2024-02-25 17:44:10 -05:00
Jeff Young
cc721c4907 Improve encapsulation of group internals.
(It's still leaking into BOARD_COMMIT and some other places, but at
least it no longer leaks into all the edit tools.)

Also fixes some bugs when moving/copying/pasting multiple selections
containing length-tuning patterns.
2023-11-09 14:05:35 +00:00
Jeff Young
791aa64950 Functionally it's a "reference image".
The implementation happens to be a "bitmap".

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15932
2023-10-24 15:44:21 +01:00
Mike Williams
91b6bb8088 Grid helpers: remove view items on destruction 2023-10-23 09:39:08 -04: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
62d959ed0e Don't assume an error location for PAD::GetEffectivePolygon().
While ERROR_INSIDE was good for plotting, 3D generation, etc., it's
not good for generating router hulls.

Also reverts part of the change to always use polygons for PNS::SOLIDs.  A single shape in a SHAPE_COMPOUND will be faster (and
more accurate).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14898
2023-10-13 13:59:26 +01:00
Marek Roszko
22b733209d Fail GAL on its header leaking audit
Maybe we should rethink directly accessing GAL so much, but at least 600 files didn't need GAL leaked into them due to view_overlay.h
2023-09-18 19:52:27 -04:00
Marek Roszko
67b031adab Painter base class should just live in gal instead of being in denial 2023-09-06 20:23:19 -04:00
John Beard
3c5052c1ac Add snaps to pad hole edges
This is often useful when measuring the distance from an
object to a pad hole edge, and also when dimensioning
holes.
2023-09-06 21:34:17 +01:00
John Beard
78c8de9b08 Fix oval pad snapping
Previously the snap points computed for oval pads didn't get all the
points correct. This breaks out the "find snap points for ovals"
into a function, reworks the logic, adds some tests.

Also adds "extremum points" when the oval isn't exactly H/V.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15594
2023-09-06 21:33:45 +01:00
Mike Williams
b8a61719c3 Grids: make overrides use existing grids (choice box) 2023-08-30 13:33:04 -04:00
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