Commit Graph

215 Commits

Author SHA1 Message Date
Jon Evans 037f349585 Make expand connection work on generated tracks 2024-02-08 19:28:28 -05:00
Jeff Young d30361b425 Increase artificial via preference further.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16880
2024-02-05 19:20:33 +00:00
Ian McInerney 7ea1568802 Fix selection tool behavior in footprint viewer
The footprint viewer isn't an edit frame, so we need to access the
settings through the base frame type instead. Also, double click makes
no sense in the footprint viewer, and just leads to weird results
sometimes.

Fixes Sentry KICAD-7A2
2024-02-05 14:50:17 +00:00
Jeff Young 0370db43ae A footprint does it's own child hit testing.
We only need to add it for groups.
2024-02-04 23:16:43 +00:00
Jeff Young cab351d249 Don't do a sided-test on a footprint which has no side.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15284
2024-02-04 15:18:23 +00:00
jean-pierre charras 89f8c5d918 PCB_SELECTION_TOOL::selectPoint() Remove items disabled by the selection filter
before using any other filter. This avoid to select an item from the candidate
list that cannot be selected and eliminate another candidate.
Fixes #16755
https://gitlab.com/kicad/code/kicad/-/issues/16755
2024-01-26 19:13:50 +01:00
Jeff Young df48ebfbe7 Restore preferential selection treatment for silk items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16607
2024-01-17 14:02:43 +00:00
Jeff Young ace4ef7b16 Implement stingy selection mode for tuning patterns. 2024-01-17 00:34:22 +00:00
Wayne Stambaugh 25c03da5a5 Coding policy and Doxygen comment fixes. 2023-12-18 08:32:41 -05:00
Wayne Stambaugh eb3fd10af8 Fix obscured object selection issue in board and footprint editors.
This selection improvement feature is hidden behind the advanced
configuration key "PcbSelectionVisibilityRatio".  It is turned off (1.0)
by default.  Value values are from 0.0 to less that 1.0.  From testing,
using a value between 0.1 and 0.3 produces the best results.

This fix uses normal alpha blending described in the link below.  The
current design only uses the alpha of the object's color.  It could be
improved by doing a full color alpha blending but using the color alpha
alone seems to result in satisfactory results.

https://en.wikipedia.org/wiki/Alpha_compositing

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16126
2023-12-17 16:43:56 -05:00
Jeff Young a96b7116d0 Make sure de-selected items get redrawn.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16385
2023-12-17 17:59:43 +00:00
Jeff Young aa046345eb Add missing case to Selectable().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16283
2023-12-07 13:41:24 +00:00
Alex Shvartzkop 111a8d6ab3 Improve/fix Expand connection for graphics. 2023-12-04 09:52:31 +03:00
Alex Shvartzkop 7eb98a9863 Fixes for tuning patterns and router.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16160
2023-11-28 20:55:39 +03:00
Jon Evans 37d9b7fac0 Prevent crash if generator exists but has no items
See https://gitlab.com/kicad/code/kicad/-/issues/15366
2023-11-25 16:01:12 -05:00
Jon Evans 87ba1f7ea0 Fix expand selection for graphic shapes on graphic layers 2023-11-20 16:14:56 -05:00
jean-pierre charras 2f594e441b Fix a compil warning (shadowed variable). 2023-11-10 10:31:40 +01: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 141b953d12 Show selection before opening menu.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15922
2023-11-03 12:36:30 +00:00
Jeff Young 7f8e397dfb Behave (or assert) when source or target are null or dirty. 2023-11-01 17:11:42 +00:00
Wayne Stambaugh 6183a1e4de Coverity warning fixes. 2023-10-30 09:16:24 -04:00
Seth Hillbrand 6d957e9d65 Don't use KiROUND when we should trunc
When calculating the viewport extents, we only need the maximum size
that can be represented.  Anything larger should be truncated.  We do
this in many other places (wx_view_controls, ruler_item,
ds_proxy_view_item, etc) and this brings pcb_selection_tool into
alignment with this, avoiding an unneeded warning message

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15529
2023-10-29 10:42:33 -07: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
Alex Shvartzkop 97901c9ac5 Fix footprints being difficult to select in high-contrast modes.
(regression)
2023-10-23 06:09:13 +03:00
Jeff Young f5e99338a9 Generators should respond to the selection filter that controls their children.
(Tuning patterns to the track checkbox, stitching patterns to the
vias checkbox, etc.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15905
2023-10-20 16:28:05 +01:00
Jeff Young 7447700735 Fix typo. 2023-10-19 11:20:09 +01:00
Wayne Stambaugh b5eee9dd7e Coverity warning fixes. 2023-10-16 17:04:14 -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
jean-pierre charras 57efde1bbb Pcbnew: rename ZONE* m_SolderMask to m_SolderMaskBridges
(It is a container to build bridges on solder mask layers by DRC, not real zone)
Disable also this special zone selection by adding it in
PCB_SELECTION_TOOL::itemPassesFilter
2023-10-13 09:57:21 +02:00
Alex Shvartzkop be72e07e61 Introduce PCB_GENERATOR. 2023-10-08 02:41:17 +00:00
Alex Shvartzkop 0fcb36bc2e Add reselectItem action. 2023-10-08 02:41:17 +00:00
Jeff Young 1047130046 Push most of footprint chooser into PANEL_FOOTPRINT_CHOOSER.
Create 2 wrappers for it: DIALOG_FOOTPRINT_CHOOSER and
FOOTPRINT_CHOOSER_FRAME.  The first now gets called from wxGrid
editors, text button editors (such as Change Footprints), etc.

Retire FOOTPRINT_VIEWER_FRAME_MODAL.  FOOTPRINT_VIEWER_FRAME still
exists, but has very few uses at this point.
2023-09-27 16:02:13 +01:00
Seth Hillbrand 91450c22cc Allow disambiguation menu configurability
Adds an advanced config flag to all testing different values for
different users.

Related to https://gitlab.com/kicad/code/kicad/-/issues/15128
2023-09-24 16:33:05 -07:00
Marek Roszko 7505fd0f37 Profile can live in core 2023-09-07 07:47:01 -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
Josue Huaroto cef0f176d3
Add Unselect all in menu 2023-09-06 23:44:39 +00:00
Jeff Young 9bba8e5956 Don't allow duplication of footprint items outside of footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15487
2023-09-03 22:04:50 +01:00
Jeff Young 69a1b30b8a Implement undo/redo around Pad Edit Mode changes. 2023-09-01 18:48:46 +01: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
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
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
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
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
Jeff Young 493828cc6b Eradicate a bunch of calls to dyn_cast.
Also deletes PAD::GetParent() which fails to look for parent footprint
through groups.
2023-06-25 11:10:07 +01:00