The thumb size changes between system versions and (on GTK) render
managers, so hard-coded wasn't working. This gets the actual value from
the system and uses to adjust the range. Changes in the range can also
trigger the refresh.
Fixes: lp:1822617
* https://bugs.launchpad.net/kicad/+bug/1822617
Fixes: lp:1816749
* https://bugs.launchpad.net/kicad/+bug/1816749
(cherry picked from commit 85df994eda)
When plotting in Eeschema, various elements may be filled with either
the foreground or background colors. The fill mode is rather unique,
requiring un-stroked pie wedges for arcs and both closed and open filled
polylines.
Fixes: lp:1840769
* https://bugs.launchpad.net/kicad/+bug/1840769
KiCad is case sensitive but we need to be consistent in displaying sort
order as case insensitive (same as file systems)
Fixes: lp:1836911
* https://bugs.launchpad.net/kicad/+bug/1836911
The base initialization of EDA_RECT sets a 0/0/0/0 rectangle that
prevents merging properly with valid EDA_RECT. This sets the default to
be uninitialized until the internal data are set.
(cherry picked from commit 46feb76aba)
libcontext currently restores and saves the FPSCR register
on ppc64. This behavior is fine (though unnecessary) on the
ELFv1 ABI which designates the register as volatile, but has
been observed to cause crashes on ELFv2 systems.
The ELFv2 ABI designates the FPSCR register as Limited-access
and specifies specific conditions that must be met to clobber
it. It does not seem that a context swap function meets these
conditions (and indeed, the save/restore register example in the
ABI document does not modify FPSCR).
This patch fixes ELFv2 ABI compliance by removing the FPSCR
save/restore code in libcontext entirely. This fixes observed
crashes on the platform and should have no consequence for
ELFv1 support.
Fixes: lp:1840088
* https://bugs.launchpad.net/kicad/+bug/1840088
(cherry picked from commit 3e22b75948)
This fixes the last suffix that was missed by 168fa09f5. The schematic
backup files should have the suffix .sch-bak to distinguish from
.kicad_pcb-bak or other backups.
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)
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.
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.
Use the wxTextValidator style flag to allow the user to clear the library
identifier string. Use wxTextValidator::SetStyle( wxFILTER_EMPTY ) to
prevent empty library identifier strings which is the current behavior.
(cherry picked from commit 9f9e87f11f)
And place bitmaps behind other items. This ensures they are drawn in
the background of the page rather than covering schematic elements.
This also hacks around the buggy wxPostScriptDC implementation that
resets the page to print an image.
Fixes: lp:1819934
* https://bugs.launchpad.net/kicad/+bug/1819934
When selecting the "Print in B&W", all items on the schematic should be
printed using black and white. This converts the embedded images
greyscale before outputting to the printer
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)
Re-arranging the stack will invalidate the iterator that is removed and
inserted (begin()). Because this is not a threaded operation, we can
only do it to ourselves, so check that the operation isn't a NOP before
performing.
Fixes: lp:1832930
* https://bugs.launchpad.net/kicad/+bug/1832930
(cherry picked from commit 552815d486)
eeschema cpp files consume generated header files that have targets in
the common directory, so no dependencies get created from eeschema. We
add the dependencies in common to force the setting through libraries.
Fixes: lp:1831643
* https://bugs.launchpad.net/kicad/+bug/1831643
When we assign a string to the wxFilename, it takes the last section as
the filename (unless there is a trailing '/'). So on Linux, we got
/home/user for the Documents dir and /home/ was the directory while
'user' was the filename. Appending directories 'kicad/templates' made
the final directory '/home/kicad/templates'. Forcing this to be a
directory restores correct behavior.
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)
This fixes multiple issues when importing Eagle V6 files.
Crashes occured when arcs of 0-length were found and when parts were
referenced in the schematic that were not found in the library. This
could happen if the library and schematic were different cases.
Fixes: lp:1830564
* https://bugs.launchpad.net/kicad/+bug/1830564
(cherry picked from commit 0e5cc54ec9)
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)
Replace INCREMENTAL_TEXT_CTRL with wxSpinCtrlDouble because it looks
and works better.
Remove INCREMENTAL_TEXT_CTRL header and source files because the only
place they were used was in GAL_OPTIONS_PANEL.
(cherry picked from commit f08d040c02)
The default is meant to be "Save" but "Discard" was selected due to ID
ordering on creation. Setting the focus before setting the default
makes the "Save" option the highlighted option that can be selected
immediately by pressing enter.
(cherry picked from commit a0f477cc5f)
Note that the comment in line 142 where the scale factor was set had the
correct value to indicate metric (1) but in the actual boilerplate, we
set imperial (0). This has been around for 6-8 years, so it would seem
DXF is not our most popular export.
Note, I initially tried to use '1' to specify metric units but this was
not handled by DXF readers (QCAM, Inkscape). Instead, scaling the page
units to inches properly seems to work.
(cherry picked from commit 0eb391b13f)
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)
Prevent user from pasting text with carriage return and/or line feed
characters in field value edit control in the schematic symbol and symbol
library properties dialogs.
Make all objects derived from GRID_CELL_TEXT_BUTTON use validators
correctly.
Add validators to FIELDS_GRID_TABLE object for field values other than
the mandatory fields.
Create a validator to check that a string is a valid LIB_ID.
Fixes lp:1828214
https://bugs.launchpad.net/kicad/+bug/1828214
(cherry picked from commit ae54f34392)
Commit e10c01aaf didn't work when touchpad panning was enabled.
This commit changes it to only discard horizontal wheel events
when in "scroll mode" rather than "pan mode".
Based on a patch by Adrian Scripcă <benishor@gmail.com>.
Follow-up to fix: lp:1828080
https://bugs.launchpad.net/kicad/+bug/1828080
(cherry picked from commit e6fe220f84)
Modern mice feature horizontal scrolling capabilities and those end
up being treated by KiCad as regular scroll events causing confusion
among users.
The fix works by discarding the handling of wheel events other than
the ones for the vertical axis.
Fixes: lp:1828080
https://bugs.launchpad.net/kicad/+bug/1828080
(cherry picked from commit e10c01aaff)
Force the symbol library links whenever the symbol library table has been
modified. This will use the cache as a fallback when a library has been
removed that contains links in the schematic rather than display.
Fix the SCH_COMPONENT symbol resolver when falling back to the cache. The
resolver was using the LIB_ID ':' notation which was failing. Replacing
':' with '_' fixed this issue. This was also an issue when generating the
symbol message panel information.
Convert wxLogDebug to wxLogTrace in symbol resolver code path. Add new
trace type KICAD_SYM_RESOLVE.
Fixes lp:1821606
https://bugs.launchpad.net/kicad/+bug/1821606
(cherry picked from commit 7d803437e2)
There is a rendering bug in GTK3, which appears to be
an upstream GTK issue.
This can be worked around by, when filtering, ensuring the
*parent* item of the selected item is visible. This will
not cause the selected item to not be visible, as the selected
item will be the first shown child. So it will be visible, as long
as the list box is greater than a single row high, which it will be
in all practical scenarios.
This is done on all platforms, as it has a beneficial side-effect:
the parent library of the selection is naturally shown to the
user, so they don't need to scroll up to see what library their
current filter selection was in.
Fixes: lp:1804400
* https://bugs.launchpad.net/kicad/+bug/1804400
(cherry picked from commit 10900c918f)
This can be helpful when tracing where certain configurations
come from (some apps load from other apps' config basenames).
(cherry picked from commit fcc4a84e0e)
This fixes the bug exposed in the previous commit.
The tests which exposed it now pass and expected failures
removed.
(cherry picked from commit d89d0e6b74)
Prevent a divide-by-zero bug in SHAPE_ARC::ConvertToPolyline.
When the radius is zero, just use the initial angle (it makes
no different anyway, the result is the centre point, which is
the start point.
(cherry picked from commit e312e2b286)
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)
On some platforms like MSVC, NaN prints as "-nan(ind)". This
is a bit needlessly ugly, so print "NaN" on all platforms
consistently.
This fixes a test failure on MSVC.
(cherry picked from commit dd17f24c04)
Both Cairo and OpenGL had issues (different, though) with circles that are
thicker in line width than they have radius. This corrects the OpenGL
implementation (radius is calculated to the outer edge) as well as Cairo
(line width needs to be clamped to twice the radius)
Fixes: lp:1822765
* https://bugs.launchpad.net/kicad/+bug/1822765
(cherry picked from commit db0523626c)
Statically constructing wxCursors as used for the probe
and tune cursors crashes the qa_eagle_plugin test
instantly.
Fix this by introducing a new class CURSOR_STORE,
which allows to abstract the platform wierdness of wxCursors
and allow the simulator to laziliy init its own cursors
at runtime.
This code isn't properly tested, as these cursors are never
actually used. However, it does allow the eeschema unit test
to run.
Fixes: lp:1781191
* https://bugs.launchpad.net/kicad/+bug/1781191
(cherry picked from commit 6f1c3f5ef8)
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)
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)
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
wxWidgets has several bugs that result in cell editors being closed
right after they're opened. There are two wxWidgets hacks to
partially address this: the SetInSetFocus() hack, and a slow-click
hack. We used to try and work-around these bugs ourselves for
single-click access, but this changelist moves those over to
wxWidget's slow-click hack.
Fixes: lp:1817965
* https://bugs.launchpad.net/kicad/+bug/1817965
The folder button handler works will for footprint libraries but we
needed a specific class for the schematic libraries as well.
Fixes: lp:1818346
* https://bugs.launchpad.net/kicad/+bug/1818346
Added checks to StrCmpNum() function in common/sting.cpp to prevent
iterating past the end of the sting. Also removed length of string
parameter since it did not seem to be used anywhere.
Fixes lp:1818157
https://bugs.launchpad.net/kicad/+bug/1818157
The cancel action was set for the escape key when editing the fields in
a dialog. But when the action is a button, we need to ensure that the
escape id is set to ANY for processing.
Fixes: lp:1818056
* https://bugs.launchpad.net/kicad/+bug/1818056
For unknown reasons, GTK3 may send resize events when editing grid
fields. This can cause the grid editor to exit, losing the focus and
overwritting the characters at the next input.
We avoid this by filtering the size events when the size doesn't change.
Fixes: lp:1817810
* https://bugs.launchpad.net/kicad/+bug/1817810
Wayland is not yet compatible with wxWidgets (or rather the other way
around). Until this happens, we must force the x11 compositor while
running. Under wayland, this will map to the wayland-x11 compatibility
layer.
Fixes: lp:1816637
* https://bugs.launchpad.net/kicad/+bug/1816637
For BUTTON_ROW_PANEL::BTN_DEF_LIST, the button definition does not need to be
passed by value, by non-const reference avoids copies and this addresses the
Coverity warnings: 184130, 184134, 184140, 184167.
Also use a unique_ptr to clarify ownership sementics when handing widget
over to WX.
In Symbol editor, axis are always shown. However after switching the backend, axis were no longer drawn.
In Cairo engine, fix a bug preventing axis to be shown.
Each dot is an integer number of pixels wide, so supporting 0.5 width
steps no longer makes sense. We round up the existing settings to the
nearest integer and only allow integers in the dialog.
Fixes: lp:1816748
* https://bugs.launchpad.net/kicad/+bug/1816748
Introduce a shortcut method to set tab ordering and use it in
the dialogs that override the tab traversal orders:
* Eeschema sheet properties
* Pcbnew Move exact
* Pcbnew Move relative
Also set some initial focus fields in the same dialogs.
Tidy a few includes.
Fixes: lp:1816009
* https://bugs.launchpad.net/kicad/+bug/1816009
We shouldn't adjust the pixel size of the grid based on alignment in
GAL. This creates artifacts on the screen at different zoom levels.
The pixel width is fixed by grid size preference
Also clean a left-over debug statement
Fixes: lp:1817377
* https://bugs.launchpad.net/kicad/+bug/1817377
A only one char is very hard to translate outside a context, so avoid to use it.
Remove also 2 "FIX ME" lines, now useless.
Fixes: lp:1817354
https://bugs.launchpad.net/kicad/+bug/1817354
Arc pixel adjustment needs to be limited to +/-1 pixel. But making this
adjustment to nearby points and then using the projection to correct the
center point accumulates errors that are large for angles near 0 and
near 360. This is a compromise that aligns _most_ arcs and provides
stable generation for all angles.
Fixes: lp:1817226
* https://bugs.launchpad.net/kicad/+bug/1817226
GTK3 provides for additional input devices via xinput2. These include
touchscreens and continuous scroll devices. But wxWidgets does not have
specialized handlers for these events, so they double up for some
devices. Until wxWidgets allows us to handle these events, we specify
that the input handler should be the old-style GDK_CORE.
GTK3 does a fade in/fade out routine for scrollbars by default. This
was problematic as it caused a cascade of full-screen repaint events on
each mouse event. Instead of disabling scrollbars (which only helped
the full canvas), we force the old scrollbar behavior is environmental
variables.
Revert "gtk3: Remove scrollbars"
This reverts commit db43bd82a7.
And filled but we don't use those yet. No pixel-alignment needed for
stroked semi-circles (I think) as we set the pixel width to be 1
regardless of the zoom level.
Fixes: lp:1816263
* https://bugs.launchpad.net/kicad/+bug/1816263
Pixel alignment is not required for track outline mode. It creates
differences between segment and radius calculations.
Also add specific width of the outlines
This creates early asserts for issues where we haven't fully implemented
a Clone() function for items or haven't correctly filtered them before
creating the undo/redo commit.
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL
Cleanup of pixel alignment patches
gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends
GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing
Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use). Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.
gal: further cleanup
gal: removed unused shader parameter
The indent size was estimated by the width of characters. But MSW
indent is substantially different from OSX and Linux. It also cuts off
the middle characters rather than the end leading to poor display if the
width does not fit. This uses the system setting for indent to account
for the indent spacing + 'M' to account for the arrow inset.
Fixes: lp:1815401
* https://bugs.launchpad.net/kicad/+bug/1815401
When filtering, we update the width of the displayed column to ensure
the full text is visible to the user. Check is rough, based on line
width (doesn't completely account for differing char widths) but is
sufficient for the approximate difference
Fixes: lp:1815401
* https://bugs.launchpad.net/kicad/+bug/1815401
Fixes: lp:1788495
* https://bugs.launchpad.net/kicad/+bug/1788495
This was previously "svg:g", but the SVG is declared with only
a "default" namespace, not an "svg:" namespace (looks like
xmlns:svg="http://www.w3.org/2000/svg" in the svg tag).
This means you cannot use svg: as a NS in the document. It's not
needed anywaY: the default is already correct.
Moreover, mismatching <svg:g> and </g> is always invalid.
When adding colors to length tuner, we depend on the window background
color, which can be set by the user, resulting in an unreadable text.
This uses the HSL conversion to detect which shade it should use for the
coloring.
Also adds test cases for round-trip HSL and HSV conversion
Fixes: lp:1814530
* https://bugs.launchpad.net/kicad/+bug/1814530
Apparently FinishDialogSettings() does need to be called on windows to
get the dialog to layout properly. Hopefully this doesn't break any of
the other platforms.
Fix wxGrid column minimal widths on Windows in dialogs (just fixing the size is not enough).
WX_GRID::GetVisibleWidth(): make width bigger for labels, because they usually use a bold font.
(However, the fix is just a workaround: a better code is welcome)