You can trigger it before this fix by running Cvpcb when a .kicad_mod file is
incorrectly set as "Legacy" in your footprint table.
(cherry picked from commit e269b5d1b9)
Setting the active layer should be tied to the events that are triggered
by the layer change and overloaded for each frame. This ties the hotkey
back to these events.
Note: In the 5.1 cherry-pick this also adds the missing hotkey to
footprint editor
Fixes: lp:1838244
* https://bugs.launchpad.net/kicad/+bug/1838244
(cherry picked from commit 494d0de9b8)
The local settings panel needs to have its children sized when shown.
Triggering a resize event on changing the pad shape accomplishes this.
This is not triggered in master due to refactor of the custom pad
connection options.
Fixes: lp:1837789
* https://bugs.launchpad.net/kicad/+bug/1837789
Adds the missing default layer to the default board setups for two
layers with parts on single side (either top or bottom)
Fixes: lp:1841294
* https://bugs.launchpad.net/kicad/+bug/1841294
We need to set the footprint local coordinates of the footprint
reference and value fields at instantiation separately from the
TEXT_DIVERS elements.
Fixes: lp:1829727
* https://bugs.launchpad.net/kicad/+bug/1829727
This modifies that logic for optimizing pad connections.
1) Custom pads now prefer the connections to their longer side. This is
particularly important to match the behavior in a rectangular pad
2) Costs for straight lines are non-zero. This favors fewer connections
3) Custom pad breakouts are at the polygon boundary rather than offset
by 0.1mm. This also matches the circular and rectangular paradigm.
4) Line Heads contained in the pad itself are not optimized. This
prevents escaping the pad unnecessarily
Fixes: lp:1824182
* https://bugs.launchpad.net/kicad/+bug/1824182
(cherry picked from commit 06cb21cc47)
TRACK::GetEndNetCode() can get called using a NULL-pointer as 'this'.
The compiler assumes this won't happen and optimizes away a NULL pointer
check at the start of the function (so we might as well remove this check.)
Fixes: lp:1840562
https://bugs.launchpad.net/kicad/+bug/1840562
The Board bounding box calculation has two modes: edges only and
everything. While the everything mode works as expected, the edges only
calculation (and everything that depends on it) was seeing only the edge
cuts on the board drawings layer and not the footprint edge cuts.
Fixes: lp:1839768
* https://bugs.launchpad.net/kicad/+bug/1839768
(cherry picked from commit 99859727e8)
When dragging, you will seldom want to snap to the original item. This
commit prevents the "size of track" snap to the original item and
replaces it with an auxilary grid origin for the snap. This means
effectively that the snap will happen to grid for the original item
unless the cursor is closer to the original item line than it is to the
grid crossing.
Fixes: lp:1820248
* https://bugs.launchpad.net/kicad/+bug/1820248
(cherry picked from commit 0de25e557b)
In rare cases, the VRML triangulator may claim to work but return empty
vectors. These cases need to be caught before we dereference the vector
elements.
Fixes: lp:1838448
* https://bugs.launchpad.net/kicad/+bug/1838448
This sets the clearance outline to a slightly better opacity to allow
viewing of items behind the routed track clearance. Future work should
include making this a configuration option.
Fixes: lp:1826719
* https://bugs.launchpad.net/kicad/+bug/1826719
1) Intermediate states might be self-intersecting, and we shouldn't
be policing our users on what order to do things in
2) The polygon might already be self-intersecting, at which point we're
preventing the user from fixing it.
Also includes better const management for SHAPE_POLY_SET API.
Fixes: lp:1833831
* https://bugs.launchpad.net/kicad/+bug/1833831
(cherry picked from commit a3c74051c2)
The returns of KiCad file extensions on GTK contain basic regex matching
case-insensitive file extensions. We need to match these in the
provider and tests
(cherry picked from commit 1956c074ba)
This adds the upper-case version of files names to the selection box for
filesystems that support case-sensitive file names.
Fixes: lp:1832853
* https://bugs.launchpad.net/kicad/+bug/1832853
(cherry picked from commit 36f70704eb)
1) Generate refreshPreview events so the modern toolset doesn't
fall behind by one event (see LP:1818667)
2) In the legacy toolset don't call unimplemented routines and don't
snap to grid on the non-movement axis.
wxWidgets sends the KillFocus event before the Cancel button event,
and it sets the receiving-focus window pointer to NULL (so you can't
even check for it being the Cancel button. Last time around (with
the UNIT_BINDER) I also tried a bunch of hacks for whether the window
pointer is NULL, etc., but they aren't discriminatory either.
Fixes: lp:1834975
* https://bugs.launchpad.net/kicad/+bug/1834975
Fixes: lp:1834966
* https://bugs.launchpad.net/kicad/+bug/1834966
(cherry picked from commit 1c30f3d9a9)
More than that just gets annoying, and there is at least one edge case
which throws us into an infinite loop if we don't have something to
break us out.
Fixes: lp:1834966
* https://bugs.launchpad.net/kicad/+bug/1834966
(cherry picked from commit 29db6152b3)
When approximating arcs for polygons, we should allow for large radius
arcs/circles without coarsening the arc beyond a limit. This is a
5.1.x-only patch to address this issue. It should not be picked to
master as this is already addressed separately by max_error
We do not allow non-copper routed tracks and they will break assumptions
elsewhere in the code. We drop them in the beginning so that they are
not saved.
Oblong holes (slots) use now a aperture attribute similar to round holes.
(The previous attribute "slot" is now deprecated)
However they have a specific aperture, and a comment is added in drill files for these apertures.
Prevent the symbol and footprint library table editors from substituting
the current project path (${KIPRJMOD}) when adding libraries to the global
library table. This will almost assuredly fail when opening a different
project. We still allow users to manually use ${KIPRJMOD} in global table
paths under the assumption that if they are typing this in then they most
likely understand environment variable substitution.
Fixes lp:1830694
https://bugs.launchpad.net/kicad/+bug/1830694
(cherry picked from commit 288982b15d)
Footprint library nicknames are case sensitive but the comparison for
the library tree control was case insensitive.
Also make the footprint name comparisons case sensitive as well. While
not strictly necessary, the plan is to start using the name defined in
the footprint file instead of the file name which will allow for case
sensitivity.
Fixes lp:1833701
https://bugs.launchpad.net/kicad/+bug/1833701
Non-copper zones do not have a fillet/chamfer option, so we need to
clear it before the zone tool uses the last-used option.
Fixes: lp:1833672
* https://bugs.launchpad.net/kicad/+bug/1833672
The previous commit missed a case where the number was so large that it
overflowed the integer invalidating the comparison. This protects
against that case by using floating point comparison.
This checks the movement against a maximum value that would place the
selection outside of the valid area for the footprint or board.
Fixes: lp:1833478
* https://bugs.launchpad.net/kicad/+bug/1833478
Custom pads are referenced to the anchor pad 0-point, so flipping the
polygon should be about 0 and not the flip point.
Fixes: lp:1831311
* https://bugs.launchpad.net/kicad/+bug/1831311
DIALOG_EXIT was not being laid out correctly after setting the dialog
message. Rather than fix our custom DIALOG_EXIT, wxMessageDialog and
wxRichMessageDialog were substituted as direct replacements for all
of the variants of DIALOG_EXIT. This make message dialogs appear more
consistent because wxMessageDialog uses the default platform message
dialog and wxRichMessageDialog uses the default platform rich message
dialog on windows.
Remove DIALOG_EXIT_BASE as it is no longer required.
Fixes lp:1832899
https://bugs.launchpad.net/kicad/+bug/1832899
(cherry picked from commit 3f665318f4ab5c02b7d3c29b5233a273fdac2e4e)
Create a new action in pcbnew, gerbview and the footprint viewer/
editor to display the help documentation. Disconnect the wxID_HELP
event from the window so that it no longer conflicts with the zoom
action.
Fixes: lp:1822041
* https://bugs.launchpad.net/kicad/+bug/1822041
Mouse capture end is called by some actions such as save board. This
resets the cursor image but doesn't change the current tool. Resetting
the cursor image during action prevents this.
This standardizes the import vector graphics file dialog to use the
sbSizer titles instead of bold+lines. Tooltip changes will be in the
next change as we don't change strings for bugfix releases and this
commit is targeted for 5.1.3
Fixes: lp:1823462
* https://bugs.launchpad.net/kicad/+bug/1823462
(cherry picked from commit f7550940ee)
We prevent the creation of invalid polygons by keeping the converging
lines from intersecting. This test doesn't make sense for triangular
polygons as they always intersect and we want to allow them to move
outside of the singular point.
Fixes: lp:1831481
* https://bugs.launchpad.net/kicad/+bug/1831481
Building custom targets that depend on custom commands such as our
keyword lexer requires two layers of indirection to pick up changes
properly and not overwrite the same file in parallel builds.
Fixes: lp:1831643
* https://bugs.launchpad.net/kicad/+bug/1831643
(cherry picked from commit c6af38477d)
Grid and ratsnest visibility are stored in the board file and should not
be changed without the user explicitly modifying them.
In the future, we'll move these settings out of the board file but we
shouldn't cause extra file-churn for flipped bits.
Fixes: lp:1828285
* https://bugs.launchpad.net/kicad/+bug/1828285
(cherry picked from commit e7e20b85b5)
Always check the return value of PyRun_SimpleString() for errors when a
Python script is run and show an error message rather than fail silently.
Enable Python interpreter I/O redirection in debug builds so that script
string errors will be shown when PyRun_SimpleString() is called.
Do not call PyErr_Print() after a PyRun_SimpleString() call failure. It
doesn't do anything useful.
Do not call Py_Finalize() after a PyRun_SimpleString() call failure. It
seems to cause Pcbnew to crash.
(cherry picked from commit 816f6db310)
KiCad does not allow references to be numeric only. This prefixes such
references with "UNK" to note that the reference designator type is
unknown.
(cherry picked from commit a62a89eac3)
Sometimes we want to inflate a polygon without adding rounded edges.
This add the option using the jtMiter setting.
This is used in the Eagle parser to expand the Eagle zones for KiCad.
Eagle Zones are drawn on the polygon edge, so they extend out from the
outline. KiCad zones are drawn inside the polygon. We need to both
increase the zone size and decrease the minimum pen width to account for
this.
Fixes: lp:1817312
* https://bugs.launchpad.net/kicad/+bug/1817312
(cherry picked from commit 490c805319)
Eagle parsing allows pin 1 to be different from the other pins in the
package but this is set by a tag marking the pin as "first" rather than
the actual number of the pin.
Fixes: lp:1829251
* https://bugs.launchpad.net/kicad/+bug/1829251
(cherry picked from commit dbc40096db)
Some how a board object was required to fetch the line width when a
footprint is being parsed. The problem is that there is no board
defined when loading Eagle footprint libraries so there was a nullptr
segfault as a result. When there is no board defined, use the default
KiCad layer line widths.
Fixes lp:1829243
https://bugs.launchpad.net/kicad/+bug/1829243
(cherry picked from commit 97166a72f5)
This is a stop gap fix. It should be possible to use the wxFrame title
string for this but some of the frame windows have appropriated the title
string for configuration file naming purposes which is less than ideal.
Fixes lp:1825977
https://bugs.launchpad.net/kicad/+bug/1825977
(cherry picked from commit 3c4f8c1bf7)
When using "Place Text" the crosshair was freezing if cancelled before
placing text.
After the crosshair freezes, the next uses of the "Place Text" or
"Add Dimension" caused the crosshair to jump to the screen location
where the previously the crosshair was frozen.
Cancelling the "Add Dimension" caused the crosshair to jump to the
screen location where the crosshair was when cancelled on the next use
of the "Place Text" or "Add Dimension".
Fixes: lp:1822578
* https://bugs.launchpad.net/kicad/+bug/1822578
The SVG importer is an advanced config. It's not supported or
normally available in 5.1, so don't advertise in the menu.
If the advanced config is enabled, the dialog will be able
to import SVG.
This could have been "Import *Vector* Graphics" like in master,
5.1 documentation will probably still say "DXF", so keep consistent.
Fixes: lp:1821571
* https://bugs.launchpad.net/kicad/+bug/1821571
When Pcbnew's add footprint browser is run up, it constructs
the recently used list without checking for nulls.
Although the DoAddLibrary call does internally check for
null, it's easier to filter these out before placing into
the vector in the first place.
The same logic in the symbol tree is already handled in the
same way.
(cherry picked from commit 42d20cbd96)
Move repeated GAL config reading routines into GAL_DISPLAY_OPTIONS.
THe app-level config is in here already, do the same for the
common config.
This means that the configs are loaded consistently, which fixes
the symbol-chooser preview window, which previously didn't use the
same config routine as other GAL canvases.
Future work could move these functions to free functions that
act on the public interface of GAL_DISPLAY_OPTIONS to avoid
GAL_DISPLAY_OPTIONS having to know about wxConfig and wxWindow.
Fixes: lp:1824524
* https://bugs.launchpad.net/kicad/+bug/1824524
(cherry picked from commit ab2281d26f)
Previously, the GAL_DISPLAY_OPTIONS object in FOOTPRINT_PREVIEW_PANEL::New
was passed by reference in the ctor, down to EDA_DRAW_PANEL_GAL, which stored
it as a reference. The object in New() then goes out of scope, so the
referencing panel outlives the options.
Fix this by making a copy in a std::unique_ptr of the options, and giving
ownership to the panel.
There is another issue here: when the Pcbnew options are copies, the
OBSERVABLE subscriber list is copied too. This means if the panel called
NotifyChanged() on the options, Pcbnew would get updates, even though a copy
of the options changed. However, the panel doesn't change the options or
notify, so it's OK for now.
(cherry picked from commit 17e88d0944)
The 3D viewer also uses OpenGL, so it also needs to
adjust based on DPI scale factors.
This patch moves the 3D viewer common config code solely
within the 3D viewer, and adds handling of the DPI scale. This
also avoids duplicated logic in PCB_BASE_FRAME::CommonSettingsChanged.
For now, as EDA_3D_VIEWER is not included in the Kiway settings
dispatch, still manually invoke the settings update from
PCB_BASE_FRAME.
The PANEL_3D_PREV gets a similar function to read the config, but
it doesn't have a listener for the update, so it's set just once
at dialog init, just like the existing pan settings.
Fixes: lp:1823681
* https://bugs.launchpad.net/kicad/+bug/1823681
(cherry picked from commit 124dd5e59a)
This behavior existed in 5.0.x but did not properly exit the edit tool
in 5.1. This removes stops the edit tool when we begin dragging a track
using the interactive router.
Fixes: lp:1820312
* https://bugs.launchpad.net/kicad/+bug/1820312
(cherry picked from commit c8118e3ce4)