Commit Graph

171 Commits

Author SHA1 Message Date
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
Ian McInerney b04e54dbea Switch TOOL_EVENT and TOOL_ACTION to have a std::any parameter
Using std::any from C++17 allows for proper type handling in the
parameter field, removing the need for casting to void* and then casting
the void* to the desired type.
2023-06-20 21:52:50 +01:00
Mike Williams 6d93950dcc PCB: abolish TEXT_TYPE::TEXT_is_*
PCB_TEXT is now always what was formerly TEXT_is_DIVERS and PCB_FIELDs
now what mandatory field type they are already.
2023-06-20 18:34:52 +00:00
Mike Williams 37837dc392 PCB: introduce PCB_FIELD_T 2023-06-20 18:34:52 +00:00
Jeff Young 111d0a2c14 Check for proxy references and values in Selectable().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14911
2023-06-10 17:47:29 +01:00
Wayne Stambaugh bdee545841 Coverity warning fixes. 2023-06-03 07:28:17 -04:00
Jeff Young 8b1fd62d35 Make pad & via teardrops 1st-class citizens (props of the pad/via)
Change teardrop generation to rely more heavily on BOARD_CONNECTIVITY
for improved performance.

Add updating of teardrops on BOARD_COMMIT::Push().

Also converts m_CopperItemRTreeCache to std::shared_ptr.
We don't copy it around anyway, and having to create a new set
of std::unique_ptr's for each operation is likely to be more
expensive than std::shared_ptr's overhead.
2023-05-19 18:02:03 +01:00
Jeff Young a9b2234f4e Use a softer Reset for grid settings.
Fixes https://gitlab.com/kicad/code/kicad/issues/14458
2023-04-04 17:05:21 +01:00
Jeff Young bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Jeff Young 897984aa22 Filter Selected Items... is inclusive, not exclusive.
Fixes https://gitlab.com/kicad/code/kicad/issues/14273
2023-03-19 20:43:18 +00:00
Wayne Stambaugh 789bf6455a Coverity fixes and code cleaning. 2023-03-02 09:04:47 -05:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Jeff Young 362d85ef50 Special selection mode when in high-contrast with courtyard layer active.
Fixes https://gitlab.com/kicad/code/kicad/issues/13521
2023-02-11 21:11:07 +00:00
jean-pierre charras fcefb5f86d Re-allows selection of bitmaps not owned by a footprint.
It was broken by my commit f8051d95
Fixes #13747
https://gitlab.com/kicad/code/kicad/issues/13747
2023-02-02 18:09:37 +01:00
jean-pierre charras f8051d954a Better handling of PCB_BITMAP items in a footprint.
- Ensure they can be erased in the FP editor
- Ensure they cannot be selected in the PCB editor (they are not show)
Fixes #13714
https://gitlab.com/kicad/code/kicad/issues/
2023-01-31 11:16:38 +01:00
Jon Evans 1ccd387c8d Exit a group when selecting a component outside it
We had this filter in place when doing mouse selection, but not when
the selection comes from another tool event.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13398
2023-01-05 20:32:52 -05:00
qu1ck 7dfa100ff0 Correctly refresh the board after action plugin run and maintain
selection
2023-01-05 14:05:15 -08:00
Jeff Young cbe5340d37 Allow pads in multi-select mode when nothing else would be selected.
Fixes https://gitlab.com/kicad/code/kicad/issues/13371
2023-01-05 17:02:50 +00:00
Greg Davill 3b55f9e326 PCB Editor: Inform tools when selecting/unselecting net
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13308
2022-12-29 13:46:20 +00:00
Mike Williams 411efe6f3d PCB Editor: Allow mouse drag of group-of-groups
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13076
2022-12-28 15:23:52 -05:00
Jeff Young 5327ea5823 Respect selectabiltiy when adding wholy-selected groups.
Fixes https://gitlab.com/kicad/code/kicad/issues/13092
2022-12-15 17:57:58 +00:00
Jeff Young 9d13e419c2 Reduce compiler warnings. 2022-12-13 00:47:19 +00:00
Mike Williams 0e75bf02fa Selection: refactor modifier checking 2022-12-08 14:12:12 -05:00
Jeff Young abd818a426 Update msgpanel after entering or exiting group.
Fixes https://gitlab.com/kicad/code/kicad/issues/13031
2022-11-29 21:33:04 +00:00
Jeff Young 226529235c Mostly const safety, but also performance opt. by avoiding shared_ptr overhead. 2022-11-22 12:21:30 +00:00
Seth Hillbrand 3b31955d98 Get hit test in group members
Fixes https://gitlab.com/kicad/code/kicad/issues/12957
2022-11-21 09:28:49 -08:00
Jeff Young c1510f07d8 Fix some issues with group bounding boxes.
Fixes https://gitlab.com/kicad/code/kicad/issues/12958
2022-11-20 23:57:36 +00:00
Alex 12a55f20d3 Fix a mistake in grip margin.
Fixes https://gitlab.com/kicad/code/kicad/issues/12952
2022-11-21 00:25:19 +05:00
Alex 38fd1c9985 pcbnew: Improve performance when something is selected. 2022-11-19 01:53:30 +05:00
Jeff Young 9d8fdd8d53 Fire selection events from SelectAll().
Fixes https://gitlab.com/kicad/code/kicad/issues/12896
2022-11-13 22:59:21 +00:00
Jeff Young 4066850f37 Use event point to determine if we're still in draggable item. 2022-11-09 13:09:01 +00:00
jean-pierre charras cb3d215b6a Fix compil and Coverity warnings. 2022-11-08 11:53:13 +01:00
Jeff Young be8bbcaac3 Send Selected event even if the result is an empty selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/12849
2022-11-07 19:47:51 +00:00
Jeff Young b5f62da5d9 Respect synthetic layer visibility when selecting footprint texts.
Fixes https://gitlab.com/kicad/code/kicad/issues/12850
2022-11-07 19:26:14 +00:00
Seth Hillbrand 8bc9d456c3 Fix area selection calculation
area was a double value for comparison of large numbers.  But the
promotion from int happened after the multiplication (and overflow) for
large images

Fixes https://gitlab.com/kicad/code/kicad/issues/12821
2022-11-03 11:46:40 -07:00
Jeff Young 403cc50e7c Don't exit group when the cancel went to another tool.
Also fixes a bug where the group border didn't get updated immediately
on enter/exit.

Fixes https://gitlab.com/kicad/code/kicad/issues/12669
2022-10-18 17:53:06 +01:00
Alex 22917860ef Move Enter Group for easier access. 2022-10-07 03:03:33 +03:00
Jeff Young 436d75e7f9 Try to reconcile SELECTION and BRIGHTENED use of overlay.
For some reason the overlay doesn't get redrawn during the PCBNew
selection disambiguation menu, so we need to not hide BRIGHTENED
items.

Fixes https://gitlab.com/kicad/code/kicad/issues/12547
2022-10-04 17:01:56 +01:00
Jeff Young 524a43f95e Don't select footprints on the wrong side if not visible.
Fixes https://gitlab.com/kicad/code/kicad/issues/12483
2022-10-04 13:22:06 +01:00
Jeff Young 6a6ef9b1f4 Bring adding-to-group and hiding in sync. 2022-09-30 16:45:00 +01:00
Mike Williams 700edb95e3 PCB Actions: Grab Unconnected
Grabs the nearest unconnected item for each selected footprint/pad.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/1986
2022-09-26 16:17:41 -04:00
Mike Williams f4a3062684 PCB: Select Unconnected
Selects the all unconnected items for each selected routable item.
2022-09-26 16:17:41 -04:00
Mike Williams ca0c9f12e0 PCB Editor: Unroute Footprint
Also works on selected pads.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/1955
2022-09-19 10:37:10 -04:00
Jeff Young 1566bd8b14 Make sure a collector has a guide before handing it to a client filter.
Fixes https://gitlab.com/kicad/code/kicad/issues/12460
2022-09-18 18:14:47 +01:00
Marek Roszko a8613ee80f Combine Iu2Millimeter & remove PcbMm2iu 2022-09-16 21:09:26 -04:00