This simple commit makes the Pcbnew copy to clipboard operation snap the
obtained cursor position to grid before the anchors are calculated. This
is also the way the move operation has been apparently working so far.
To be clear, this will not remove all cases where the copy reference
point is not aligned to the grid (see the linked Gitlab issue for
details about the problem). This will still occur for zone outlines that
are not axis-aligned. But such behavior has been so far also present in
the moving operation, so this may be as designed.
Fixes https://gitlab.com/kicad/code/kicad/issues/7507
The automatic wire tool was not working in the gridless mode because the
grid snapping on/off logic present in `EE_GRID_HELPER`, based on the
value of `m_enableGrid`, was not taking into account that another check,
but for the global KiCad setting, would be performed in the `Align()`
method, which is inherited from `GRID_HELPER`.
I've modified all tests of `m_enableGrid` value to also take the global
setting into account, and moved checks for it to `Align()` method, as
it's more consistent this way.
I've also removed an override of the `Align()` method in the
`PCB_GRID_HELPER` class, as it was made redundant by my changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/7402
Some differences are due to difference between libraries being files
in symbol editor and directories in footprint editor, but this unifies
most of the rest.
It also dispenses with the save-to-library vs save-to-document distinction
in the GUI because it makes for too much variability in the GUI, was
implemented differently between the two editors, and isn't needed as much
anymore now that we have the highly visible infobar.
There was also an issue that the save-to-board icon occupies the same
location and has the same size/shape/colours as the Board Setup icon in
PCBNew.
Fixes https://gitlab.com/kicad/code/kicad/issues/7215
Physical layer test needs to be board-visible-layers, not pad-layers.
Also cleans up the tests so that LOD factors in. (When things
disappear due to zoom level they should not be selectable.)
Fixes https://gitlab.com/kicad/code/kicad/issues/7238
For some reason the post-pinned local variable references were replaced
with calls to the points themselves (which are the pre-pinned values).
Fixes https://gitlab.com/kicad/code/kicad/issues/7291
One way to do this would have been to keep the Uuids in the editor
copy. However, this opens us up to errors if we forget a Save As or
export path and end up writing the Uuids out somewhere else.
In the end, it felt safer to store a map of the original Uuids and
restore them if we happen to save the editor footprint back to the
board.
Fixes https://gitlab.com/kicad/code/kicad/issues/7312
... because that's where we do hole-to-copper clearance testing.
Also augments the Clearance Resolution reporter to report on said
hole clearances.
And changes the interpretation of HOLE_CLEARANCE_CONSTRAINT to include
local pad clearance overrides.
Fixes https://gitlab.com/kicad/code/kicad/issues/7325
Non-layer elements can be logical centers for the circle and arc tools.
We allow the non-layer to snap for the center points and revert to only
on-layer elements after
Fixes https://gitlab.com/kicad/code/kicad/issues/7327
CHANGED footprint positions files -> component placement files.
Not all footprints get placed, so component is a more neutral word.
Use of "placement" instead of "positions" removes the double-plural
that makes footprint positions files such a mouth-full.
Fixes https://gitlab.com/kicad/code/kicad/issues/7097
Show the dragging tools in the context selection menu when a single
component is selected. Prevent the dragging tools from appearing when
more than one object is selected, as they will not activate anyway.
Fixes https://gitlab.com/kicad/code/kicad/issues/7258
Also fixes some latent bugs with not updating the local ratsnest
visibility in other places, and the netcode in update PCB from schematic.
Fixes https://gitlab.com/kicad/code/kicad/issues/7202
After a rotation or flip the reference point has to be restored to the
previous value to prevent the dragged item from warping to the cursor.
Before this change, the reference point was only cleared, causing odd
behavior when a rotation or flip was performed.
Fixes https://gitlab.com/kicad/code/kicad/issues/7112
Two issues found with the locking system used to prevent access to
stale connectivity data during the zone fill process:
1) a std::mutex has undefined behavior if you try to use it to guard
against access from the same thread. Because of the use of wx event
loops (and coroutines) it is entirely possible, and in some situations
inevitable, that the same thread will try to redraw the ratsnest in the
middle of zone refilling.
2) The mutex was only guarding the ZONE_FILLER::Fill method, but the callers
of that method also do connectivity updates as part of the COMMIT::Push.
Redrawing the ratsnest after the Fill but before the Push will result in
stale connectivity pointers to zone filled areas.
Fixed (1) by switching to a trivial spinlock implementation. Spinlocks would
generally not be desirable if the contention for the connectivity data crossed
thread boundaries, but at the moment I believe it's guaranteed that the reads
and writes to connectivity that are guarded by this lock happen from the main
UI thread. The writes are also quite rare compared to reads, and reads are
generally fast, so I'm not really worried about the UI thread spinning for any
real amount of time.
Fixed (2) by moving the locking location up to the call sites of
ZONE_FILLER::Fill.
This issue was quite difficult to reproduce, but I found a fairly reliable way:
It only happens (for me) on Windows, MSYS2 build, with wxWidgets 3.0
It also only happens if I restrict PcbNew to use 2 CPU cores.
With those conditions, I can reproduce the issue described in #6471 by
repeatedly editing a zone properties and changing its net. The crash is
especially easy to trigger if you press some keys (such as 'e' for edit)
while the progress dialog is displayed. It's easiest to do this in a debug
build as the slower KiCad is running, the bigger the window is to trigger this
bug.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6471
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7048
Before processing the select tool actions, we check if the router is
currently active and if it is, pass the event for processing in other
tools
Fixes https://gitlab.com/kicad/code/kicad/issues/7021
Check for footprint editor
Promote pad edits to footprint edits iff
- Pad is locked
- Footprint is not
Otherwise, handle the pad normally and prompt for locked items if found
Many, many KIDIALOGs use OK/Cancel and then rename both buttons to
confirm or deny some action. In those cases we *do* want to store
the deny actions if they check "Do Not Show Again".
Fixes https://gitlab.com/kicad/code/kicad/issues/6979
Prompting to unlock is obtrusive and blocks the common action of
dragging from a pad to align footprints. The less common action of
editing pads in layout can be accomplished after unlocking the pads
Fixes https://gitlab.com/kicad/code/kicad/issues/6997
Our rendering pipeline is not set up for this kind of speed,
and this is a blocking operation at the moment.
Note that we will get an update at the end of the move
because OnModify does it.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6819
During the first expansion, we are supposed to stop at vias and branches
(where three track ends connect). This needs to account for the number
of vias and tracks not just tracks
Prevents line splitting behavior needed in v5 when drawing polygons on
courtyards. Also provide property dialog with some smarts to handle
special layers
Fixes https://gitlab.com/kicad/code/kicad/issues/6900
CHANGED: If you flip or rotate an item or selection of items, move
the mouse, press 'M' and start moving the mouse, the selection jumps
to where the mouse is. This MR fixes that so it doesn't happen.
This bug was reported against the 5.1.x branch but also affects the
5.99 branch. This MR is for the 5.99 branch.
Fixes https://gitlab.com/kicad/code/kicad/issues/4069
It's much more useful to use the locked items as targets.
Also fixes some issues with commits getting the wrong items when
pads are promoted to footprints.
Fixes https://gitlab.com/kicad/code/kicad/issues/6859
Locked pads are a bit different from other locked items
and there are sufficient reasons to need to select them
that it makes sense to introduce this inconsistency.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6837
CHANGED: Ctrl-middle mouse button double click should perform
'Zoom to Objects' in Pcbnew, but a change in modifier key handling
broke it. This MR restores the functionality.
Fixes https://gitlab.com/kicad/code/kicad/issues/6740
CHANGED: manually-placed (stitching) vias won't have their nets automatically updated
(unless the via is placed directly on a track segment)
CHANGED: stitching vias can be placed on footprint pads and pick up their nets
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5484
Don't use the same "post_*" icon in the treeview. The badge gives an
action that doesn't apply in the treeview.
Also renames different file blobs to the "file_*" prefix.
Also removes EditToolSelectionFilter which was misused in more places
than it was used correctly. The original point of the client filter
was to move the logic to the point of use, which the
EditToolSelectionFilter sort of obviated anyway.
Fixes https://gitlab.com/kicad/code/kicad/issues/6751
In this case it's reactivated when the move command ends; only the
move command was ended because of activating the measure tool so it
gets activated twice.
Fixes https://gitlab.com/kicad/code/kicad/issues/6321
This unifies everything under a single architecture with a "don't
show again" dialog. Since everything now goes through the same
path it should be reasonably easy to make it do whatever we want
in the future.
Right now it presents 3 options: modify only unlocked items, override
locks and modify all items, or cancel command.
It doesn't pay to try and be too smart as it just confuses people.
When the bugs come in that it doesn't dim I'll just be marking them
as "as designed". :)
Fixes https://gitlab.com/kicad/code/kicad/issues/6367
For some reason, a footprint loaded from the fp viewer did not have its
view parameters fully updated (view bounding box not moved to the right place).
The fix ensure these parameters are updated.
If all the uncovered space is at the very edge it doesn't feel like
there's anywhere to click but the disambiguation menu doesn't come
up.
Fixes https://gitlab.com/kicad/code/kicad/issues/6584
1) make sure we get the default netclass when we want it
2) escape for HTML (particularly important for "<invalid>", but also
for reporting user rule names, netclass names, etc.)
Do not use the alt modifier key to force the display of the heuristic
context menu. This causes a conflict with menu selection on windows
and immediately dismisses the disambiguation context menu.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/1873
Also a rationalization of text polygon generators, with the "standard"
version inherited from BOARD_ITEM now giving the bounding box. This
requires callers who want the (much) more expensive stroke-based one
to call it explicitly (and brings PCB_TEXT in line with the was FP_TEXT
already was.
Fixes https://gitlab.com/kicad/code/kicad/issues/6525
The new shape architecture gives us the opportunity to make text
selection much more intuitive by actually looking at the glyph
shapes. Before text would be selected when you clicked in the
descenders area (which was usually blank given uppercase letters
and digits).
Fixes https://gitlab.com/kicad/code/kicad/issues/6525
Groups do not own their children; they only reference them. That
being said, they do own *selection* and *moving* of their children.
This might address some of 6493, but in any case will be a
pre-requisite for fixing it.
Fixes https://gitlab.com/kicad/code/kicad/issues/6493
- ref and value texts were converted to user texts.
- fpid was left empty, thus creating a potential issue if pasted in the board editor.
Now:
- ref and value texts are no changed, and not copied is pasted in the footprint editor
(these texts already exist)
- a dummy fpid (clipboard:<md5 string>) is added if pasted in board editor
(Pasting a (partial) footprint from fp editor to a board editor is certainly not
a good idea but is possible)
It shows much more detail. Removes some nag dialogs and places
hypertext links in others.
Also fixes the auto-layer-showing to correctly show Edge.Cuts or
F.CrtYd or B.CrtYd for errors relating to them.
Fixes https://gitlab.com/kicad/code/kicad/issues/6446
* Fix the display of dimension units in the properties dialog. It was
previously not showing automatic units in the dialog.
* When placing dimension items (e.g. from paste or append), update the
units to the board units when the dimension uses automatic units.
Fixes https://gitlab.com/kicad/code/kicad/issues/6267
1) Make them easier to select.
2) Mirror text when flipping to other side of board.
3) Flip around a more "known" point (the text position isn't really
here nor there).
Fixes https://gitlab.com/kicad/code/kicad/issues/6219
The Wait() function will return a null TOOL_EVENT when the tool
stack is shutting down, so we can't just always pass the event,
instead we must check for null and end the looping if a null
event appears.
forced mode, when the graphic polygon tool is active, but a graphic item is not started.
(The code was using the last created point, but it does not exist before starting
a line)
Fixes#6079https://gitlab.com/kicad/code/kicad/issues/6079
It's only needed in PlaceModule() and creates problems here. Also
adds a comment regarding the encapsulation leak that makes all this
hard to maintain.
Fixes https://gitlab.com/kicad/code/kicad/issues/5932
* Make the ruler able to switch to mils after creation
* Cleanup an unused flag in Pcbnew dimensions
* Move unit changed notification into EDA_DRAW_FRAME so more
frames to use it.
* Allow switching units when GerbView ruler tool is active
Unlike eeschema, PCBNew has had a selection model for two major
releases so folks have gotten used to RMB acting on the selection
rather than what's under the mouse.
Plus it makes RMB after a drag-select nearly useless as your mouse
by definition ends up outside the selection bbox.
Fixes https://gitlab.com/kicad/code/kicad/issues/5857
This uncovered a memory corruption bug in MODULE's move operator,
several bugs in MODULE's move and copy constructors, and a bug in
BOARD's GetItem() call.
It also bumps the file format for saving/restoring groups inside
footprints.
We can't check for selected on parent groups because the order isn't
defined (and the parent may not yet have been selected). Check for
inclusion instead.
Before the selection filter, this heuristic made sense, but
now there is an explicit toggle to disable selection of locked
items, so we want to be able to select pads when that toggle
is enabled.
Also simplifies groups so that other areas of code that have to know
about them at least don't have to know as much. One of the simplifications
is to not worry so much about empty groups until save time; others are in
the access logic to parent groups.
Also simplifies user model slightly by removing Merge and Flatten
(which are just ungroup/group and ungroup/ungroup/.../group).
Also allows multiple groups to have the same name. This is useful when
using groups for a classification system.
Fixes https://gitlab.com/kicad/code/kicad/issues/5788
CHANGED: GetDocumentExtents() in 'eda_draw_frame.h' now has a bool
parameter "aIncludeAllVisible" with a default value "true" which makes
it behave as it did before adding parameter. If "aIncludeAllVisible"
is false, the returned bbox ignores some items depending on which
program it is running in.
CHANGED: Made "Zoom to Objects" use only PCB edge in Pcbnew. This
allows text, notes, etc outside the PCB edge to be excluded in the
zoom calculation.
CHANGED: Added "Zoom to Objects" to Pcbnew main menu, and to RMB context
menus for Eeschema and Pcbnew.
Fixes https://gitlab.com/kicad/code/kicad/issues/5787
ADDED memberOf() function for DRC rule expressions.
Also fixes a bug in several of the pickers where the event wasn't
being correctly passed.
Fixes https://gitlab.com/kicad/code/kicad/issues/5647
ADDED: Make middle mouse button double click do a 'Zoom to Fit'
in Eeschema, Pcbnew, and Gerbview. Ctrl-MMB does a 'Zoom to Objects'
in Eeschema.
Fixes https://gitlab.com/kicad/code/kicad/issues/1988
These objects can now be used in advanced DRC rules and
not just for keeping things out. Also remove the restriction
that at least one of the "basic" keepout rules must be set,
so that these areas can be used for more advanced rules.
1) better load-balancing for deferred zones
2) sort zones by priority before filling
3) retire BOARD::GetZoneList() which had a horrible performance profile
4) implement a zone bounding box cache
5) better checks for IsCancelled() so long fills can be exited
Fixes https://gitlab.com/kicad/code/kicad/issues/5738