13 Commits

Author SHA1 Message Date
John Beard
d90862b444 Pcbnew: fix snapping view update after hover delay
Te update didn't refresh, so the snap extensions sometimes only
appeared after the _next_ mouse move, which was annoying when the
mouse was very still (e.g. when deliberately hovering over an item).

Use a wxTimer to put all the callbacks in the UI thread which is also
much simpler. Also the update function needs to call a canvas refresh
as well as the item update.
2025-01-28 08:50:31 +08:00
John Beard
c120254aa4 Pcbnew: snap to object faster if no objects activated
Otherwise it's annoying to snap to the first item you get to
if you have to wait every time.
2025-01-25 23:57:38 +08:00
Jeff Young
59f20cdedc Fix Mac build. 2025-01-24 16:06:22 +00:00
John Beard
de7f735856 Pcbnew: fix extension snaps for initial persistent items
Specifically, do not race the delay against the proposal
cancellation for the initial items, but just accept them
immediately.
2025-01-24 03:46:58 +08:00
Wayne Stambaugh
e09b095533 Common folder housekeeping part 3. 2025-01-16 11:50:08 -05: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
Jon Evans
031c5417a1 Fix build on macOS 2024-10-26 21:48:54 -04:00
John Beard
f09d274a3e Construction geom: thread must be constructed last
If the thread starts before the proposal tag is constructed
as nullopt, the thread can unblock and think it has a proposal.
This isn't true, so it reads junk memory and crashes.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18835
2024-10-27 07:41:16 +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
8f95211bbe Construction mgr: protect batch containers
These are added to from the activation delay thread, but
accessed from the tool thread (e.g. via computeAnchors)
so they should be protected from concurrent access.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18835
2024-10-05 23:53:08 +01: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
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
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