Make a few things const (specficially the reference into
m_fieldStore - we should commit to not modifying that in this
function.
Also avoid a couple of needless string copies.
Also explicitly dereference the into a (non-const) reference at the outset.
For the whole if this function, comp is the same object and may not
be null (as it is used unchecked).
(cherry picked from commit edd94ce2d6)
For now fields created in Fields Editor are placed at
position (0, 0).
Every new field must be placed at the origin of
the parent component.
(cherry picked from commit 11f03c8551)
Introduced by 416e64a334. The code
appears to have been stepped on purpose but this would be incorrect for
most applications. There remains a good deal of cleanup in mathplot
available for the motivated dev.
Fixes: lp:1810311
* https://bugs.launchpad.net/kicad/+bug/1810311
(cherry picked from commit c1c4a0925d)
wxPlatformInfo::Get() causes a linker error on Msys2.
Fix this by making common link wx explicitly, rather
than implicity via it's dependencies, which cause
wrong-order linker command lines on windows.
(cherry picked from commit aef369f4af)
First, add automatic detection of toolkit DPI scaling options. For now, this
is, in order,
* Check the GDK_SCALE option under GTK+ (users can set this to force the scaling)
* Check the value from WX's GetContentScalingFactor(). This will start to work
correctly from WX 3.1 and GTK+ 3.10.
Then, add a user-settable override in the main prefs panel, next to the icon
scaling. This is independent of the icon scaling options.
DPI handling is performed in a standalone class, so they can be shared between
the prefs UI and the OpenGL backend easily. Also means Cairo could use the same
interface in future.
Also adjust the OpenGL grid drawing code to use the computed scale factor,
which avoids over-thick grids in scaled environments (the user can manually
thicken the grid if wanted).
Fixes: lp:1797308
* https://bugs.launchpad.net/kicad/+bug/1797308
Cherry-pick of: 567bdd9b9 (master)
Commit 6006703798 fixed a crash but broke the filled zones changes detection.
Filled zones were always seen as not up to date due to the fact the filled areas were cleared too early.
The up to date detection is also optimized: the old filled polygons are no longer stored.
Instead of, the MD5_HASH is calculated and stored before clearing the filled polygons.
Make the "Define as power symbol" checkbox tooltip more descriptive so
the user has a better understanding of enabling this option.
Fixes lp:1804932
https://bugs.launchpad.net/kicad/+bug/1804932
(cherry picked from commit a7c8df5666)
Autosave was not working correctly, partly due to different
implementations in eeschema and pcbnew and partly due to a mistaken
refactor at some point during v5 development. This unifies the expected
autosave prefix to _autosave- for both pcbnew and eeschema. It also
unifies the expected suffix for the backup files to -bak.
Fixes: lp:1820433
* https://bugs.launchpad.net/kicad/+bug/1820433
(cherry picked from commit 078320e2fb)
Call base object TransferDataFromWindow() to prevent Validate() from
being called twice. Validation is handled completely under the hood
so there is no need to call Validate() directly.
Fixes lp:1820301
https://bugs.launchpad.net/kicad/+bug/1820301
The bounding box calculation needs to be fast and is threaded in many
places in pcbnew. We cannot invalidate items (the function is const but
this wasn't caught at compile-time for some reason) when getting the
bbox. This shouldn't be an issue as the m_BezierPoints is rebuilt each
time the curve is updated, so rebuilding during the bbox seems extra.
Fixes: lp:1819984
* https://bugs.launchpad.net/kicad/+bug/1819984
(cherry picked from commit ec24981cc8)
Previously, refilling a zone after edition was made silently,
thus creating not understandable but very noticeable freeze time for complex zones.
(cherry picked from commit 3692c511d0)
Removing existing fills will prevent re-drawing invalid polygons before
they are ready. This seems to happen on Macs more easily due to redraw
timing.
Fixes: lp:1819553
* https://bugs.launchpad.net/kicad/+bug/1819553
(cherry picked from commit 6006703798)
We add LIB_ALIAS to the VIEW rtree when choosing a new symbol or
browsing. The actual display element may change based on the unit or
demorgan representation but there will only ever be a single one drawn.
This will set the view bbox to maximum to ensure it is always checked
for drawing.
Related to lp:1796960
https://bugs.launchpad.net/kicad/+bug/1796960
(cherry picked from commit d25d62295a)
This was due to the stub removal tests if a stub end is outside a solid area to remove it.
There is a corner case: is the stub end is exactly on a solid area outline extra segment
created by Fracture() used in calculations.
The stub removal tests are now made before fracturing.
Fixes: lp:1819317
https://bugs.launchpad.net/kicad/+bug/1819317
(cherry picked from commit b9944e2c06)
The module refdes always increment by one. This is problematic
for two reasons:
* It doesn't work when more than one FP is selected (say you have
C1 and C2, you get C1, C2, C2, C3)
* It messes with simple panellisations
The 5.0.x behaviour is to not renumber in Pcbnew, so revert to
that behaviour.
Better refdes incrementation can come post 5.1, as this will need
new strings and UI.
Fixes: lp:1819106
* https://bugs.launchpad.net/kicad/+bug/1819106
Clang compiler uses the same syntax for sending flags to the linker as
gcc. If we use -XLinker, we can't use comma-separated options but
there appears to be no reason to anyway. Removes extra warning quieting
that was added for compiling Boost in tree.
Disable the text update event for the orientation cutom value field before
updating it when the radio buttons are selected. This allows to use the
conventional EVT_TEXT handler, rather than KEYDOWN, which has two effects:
* Tabbing though the dialog no longer sets custom orientation
* Click-driven clipboard actions trigger the update correctly.
Introduce a helper function in validators.h to assist in updating
validated fields without triggering further events.
Fixes: lp:1819006
* https://bugs.launchpad.net/kicad/+bug/1819006
When checking for closed outlines, we generate a board area using the
pcb structure. We now also check for overlapping outlines due to
lp:1818163 However, the DRC maintained its previous outline before
generating the new one, causing an overlap error.
This regenerates the board outline from zero for each DRC run.
Fixes: lp:1819012
* https://bugs.launchpad.net/kicad/+bug/1819012
pcbnew refreshes the viewItem for the worksheet multiple times. This
requires setting the filename to get parameters displayed on the
worksheet correctly.
Fixes: lp:1819000
* https://bugs.launchpad.net/kicad/+bug/1819000
Depending on thermal reliefs size, the polygons could be self intersecting,
and these self intersecting polygons are unexpected in zone calculations.
Other fix: the width of thermal stubs is clamped to the size of pads.
Previously, a bug in clamping calculations prevents constraining thermal stubs width.
Fixes: lp:1818752
https://bugs.launchpad.net/kicad/+bug/1818752
When creating a new project from a template, we should follow the
same workflow as creating an empty project. Without this, the project
requires the directory to exist and the form doesn't allow creating new
directories (in GTK3 at least).