Commit Graph

4353 Commits

Author SHA1 Message Date
Marek Roszko eff9c46e59 Replace wxTextFile for writing fp info cache
wxTextFile uses wxFile which uses write syscalls which means its unbuffered.
This makes file IO more expensive against network shares where it will flush far too aggressively.
wxTextFile is fine for reads however.
2020-12-11 22:34:56 -05:00
jean-pierre charras 676d35f559 Replace wxFloatingPointValidator by our UNIT_BINDER in DIALOG_TEXT_PROPERTIES.
wxFloatingPointValidator has some limitations, but mainly the change is a try
to fix an annoying issue (#6670) we cannot reproduce but is probably related
to a locale issue.
2020-12-09 19:45:03 +01:00
Wayne Stambaugh e8bc4632b4 Minor dialog and other layout fixes.
* Fix clipped bitmap buttons.
* Remove colons from the end of wxStaticBoxSizer strings.
* Minor padding improvements.
2020-12-08 09:19:32 -05:00
Seth Hillbrand 7eea344f91 Fix/workaround GTK libtree issue with multi-unit symbols
When preparing for clearing the tree, GTK requires walking through
parents.  After calling "Freeze()" to protect against returning bad data
(see #6458 and #4471), we can no longer access Parent() from GTK and the
tree cannot be cleared.

The fix is to collapse the first element if it is open.  This prevents
the common case of the history elements being expanded in the tree

Fixes https://gitlab.com/kicad/code/kicad/issues/6102
2020-12-03 14:12:58 -08:00
Mark Roszko 5a6f291c72 Remove infinitely recursive loop on Windows (in special cases)
This looks like it was always intended for macOS but was accidentally changed for Windows as well.
If this is a requirement on windows, I'm sure theres better ways to fix it....

Cherrypick from 98ece9d
2020-11-02 13:45:14 +00:00
Roberto Fernandez Bautista 3404f4e86b Check GLEW functions exist before calling them
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6235
2020-10-30 19:45:33 +00:00
Roberto Fernandez Bautista 6c07ebe5f2 Combine return statements in OPENGL_GAL::CheckFeatures 2020-10-30 19:43:22 +00:00
Roberto Fernandez Bautista 24a4f06013 Fix OPENGL_GAL initialization sequence (Version for 5.1)
- New public static function OPENGL_GAL::CheckFeatures() gets called in EDA_DRAW_PANEL_GAL::SwitchBackend() before switching to OPENGL_GAL
- Moved all OpenGL feature checks from OPENGL_GAL constructor to OPENGL_GAL::init()

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4714
2020-10-30 17:38:19 +00:00
Seth Hillbrand 73bf4cbce7 Unselect and freeze before starting reset
In some cases, the BeforeReset() will cause an iteration over the tree
elements.  If we have deleted an element before doing this, we risk a
corruption/crash.

Fixes https://gitlab.com/kicad/code/kicad/issues/6192

(cherry picked from commit 3bd080b64e)
2020-10-30 10:00:36 -07:00
Seth Hillbrand 8aede85214 Correct freeze ordering in lib_tree_model
Adapts the BeforeReset()/AfterReset() logic to the 5.1 branch

Fixes https://gitlab.com/kicad/code/kicad/issues/6102
2020-10-26 11:28:58 -07:00
Marek Roszko 2d25d37112 Fix focus theft, Windows sends mouse events to windows regardless of focus.
We need to check if the window is foreground before fight over focus which will make the window foreground if it wasn't.

Fixes #4099
Fixes #5958
2020-10-17 00:53:26 -04:00
Mark Roszko a3172d643f Add wxTimer stallout fix to tool dispatcher 2020-10-15 04:51:07 +00:00
Ian McInerney c30dc04571 Skip the slider event to allow the stepping to work
The stepping is in a static event handler, so it is called
after the dynamic handler and so the dynamic handler must
allow the event to continue processing.

Fixes https://gitlab.com/kicad/code/kicad/issues/5319
2020-08-29 23:32:11 +01:00
Marek Roszko 18490162f7 Use a local tmp file for plotting
Fix #5238

(cherry picked from commit de7a1b647c)
2020-08-20 15:28:18 -07:00
Ian McInerney 8ee1a7f67f Preserve the externally defined variables in the configure paths dialog
Previously the variables that were defined externally weren't being
readded to the variable map, so they would not appear in the dialog
the next time.

(Cherry-picked from fedc6519cd)
2020-08-12 00:29:17 +01:00
Ian McInerney 475385d876 Force regeneration of the lib tree on first load
Just setting the text field is not guaranteed to fire
a text event, so we must forcefully call the regenerate
function to ensure the preselect is handled.

Fixes https://gitlab.com/kicad/code/kicad/issues/4105

(Cherry-picked from 63b53c3968)
2020-08-12 00:27:33 +01:00
Ian McInerney 1b967a07e5 Remove shadowing linewidth member from the Cairo GAL
The base GAL has the linewidth property already, and its
accessor will only return the base version. This was causing
problems with the Cairo printing GAL, since that setter wasn't
using the base class version. Also, this removes the print-specific
setter, since the actual setting of line width shouldn't be done
there and is instead done where the drawing happens.

Fixes https://gitlab.com/kicad/code/kicad/issues/5089

(Cherry-picked from 5684708b22)
2020-08-11 00:54:23 +01:00
Jeff Young 621bfe36a8 Convert smart quotes and dashes in reports to ASCII quotes and dashes.
Fixes https://gitlab.com/kicad/code/kicad/issues/1861
2020-08-10 18:30:46 +01:00
Jeff Young c1849f7e00 Don't throw out search hits because they have unit children.
(Cherry-picked from 6aa0ceff36)

Fixes https://gitlab.com/kicad/code/kicad/issues/3746
2020-08-10 17:04:36 +01:00
Ian McInerney 78a7dd3269 Properly dismiss the grid combobox editor when it loses focus
The old way of checking for focus loss caused GTK to be unable to
even open the combobox. This way checks for the event sent when the
list closes and uses that to close the grid editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/4617

(Cherry-picked from af24a5d5a7)
2020-08-06 02:02:32 +01:00
jean-pierre charras 13b8708e58 Better fix for OPENGL_GAL::DrawSegment() than initial commit 5bdc78e.
segments having a length <= 1 internal unit are not drawn in opengl gal.
So these segments are drawn as circle.
Fix from master branch.
2020-07-31 15:44:24 +02:00
Seth Hillbrand 5bdc78e3ba GAL: Fix issue with small tracks being hidden
When drawing segments that are smaller than the segment width, OpenGL
did not use realistic values, leading to hidden, small tracks.  Instead,
we set the track to only draw a segment when the length is at least 1
radius long (so that we can see the full semi-circle at the track end)

Fixes https://gitlab.com/kicad/code/kicad/issues/5009

(cherry picked from commit 294dabf640)
2020-07-30 15:12:17 -07:00
Seth Hillbrand bce8fb31ab Mirror hidden text in SVG plotter
We output a 0 opacity text in the SVG plotter to allow searching.  When
this text is changed to 100 opacity, it can show up on the user screen
and so needs to be mirrored to match the stroke font output

Fixes https://gitlab.com/kicad/code/kicad/issues/5001

(cherry picked from commit b650e4568b)
2020-07-30 06:26:49 -07:00
jean-pierre charras 77d7d21130 Simulator: optimize a plot function, to support large amount of points.
Redundant points are not plotted.

From master, commit 010316457
2020-07-29 08:55:45 +02:00
Seth Hillbrand fed1520a8e Treat 0-length ovals as circles
Some buggy SVG interpreters can't handle 0-length ovals.  In this case,
they are meant to be circles, so we can export as circles in our
plotter.

Fixes https://gitlab.com/kicad/code/kicad/issues/3995

(cherry picked from commit e38ab6c699)
2020-07-28 09:53:26 -07:00
jean-pierre charras 284d5861dd Remove creation on the fly of wxPaintEvent instances, not allowed in 3.1.4 wxWidgets
From master branch
2020-07-18 08:24:58 +02:00
Urja Rannikko ee6154c842 GAL: Remove dead code regarding SHADER_LINE_B in the fragment shader
The only test for it was only called from a function
that's called if the mode is SHADER_LINE_A, not B.

(cherry picked from commit 65ceeebc71)
2020-07-17 14:10:29 -07:00
Urja Rannikko 709197c294 GAL: Round the incoming mode parameter in fragment shader
This fixes some letters being randomly boxes and some circles
being randomly triangles on the Mali T760.

(cherry picked from commit aa7ab46a06)
2020-07-17 14:07:34 -07:00
Jeff Young ee96937fd4 Scale polygon drawing guides with zoom.
Fixes https://gitlab.com/kicad/code/kicad/issues/4769

(cherry picked from commit e26625fc99)
2020-07-01 17:34:35 +01:00
jean-pierre charras 835debe75e Gerber plot solder mask layer: prepare new algo to avoid merging pads in zones 2020-06-18 17:54:00 +02:00
jean-pierre charras 56a17b4e68 Gerber plotter: ensure the gerber region for a round rect pad is always closed.
Due to rounding issues, sometimes (especially for rotated pads)
the region (4 segments+4 arcs) was incorrectly closed
1 unit (nanometer) mismatch between start point and end point.
Although it does not create bad shape, its breaks the round rect pad
identification in CAM tools. start point and end point are now the same.

From master.
2020-06-12 10:54:09 +02:00
Wayne Stambaugh a16e9ac76a Symbol editor: fix crash when editing new symbol value field.
Fixes https://gitlab.com/kicad/code/kicad/issues/4471
2020-05-21 16:46:00 -04:00
emC5RgViIK 66f70e5da6 (Cherry-picked from 47297402d3) 2020-05-15 12:37:41 +01:00
Simon Richter 5a187c6ca8 Make sure that Ninja knows the version header (fixes #4209)
This is required, because Ninja otherwise doesn't properly rebuild after
updating the version string header file.

Because BYPRODUCTS requires CMake 3.2, bump the minimum version and remove
now unused compatibility code for older CMake versions.
2020-05-15 10:51:12 +00:00
Jeff Young c6042100f9 Add ~ processing in env vars.
Fixes https://gitlab.com/kicad/code/kicad/issues/1829

(cherry picked from commit 3a9746c657)
2020-05-14 00:35:10 +01:00
Jeff Young 36d716bb50 Update toolbars when changing units.
Fixes: lp:4249
* https://bugs.launchpad.net/kicad/+bug/4249
2020-05-12 22:58:15 +01:00
jean-pierre charras 4e217d4028 SVG plotter: fix some issues: incorrect bitmap size and missing lines in header.
From master branch.
2020-04-24 16:52:50 +02:00
Marcus Comstedt 9cb60dcdf5 Cairo GAL: fix incorrect use of pixman formats
Fixes https://gitlab.com/kicad/code/kicad/issues/3970

(cherry-picked from 55ac575a88)
2020-04-15 01:29:50 +01:00
Jon Evans af6db68816 Defer image surface destruction until next paint
Fixes #4043

(cherry picked from commit 23c1baae8e)
2020-04-15 01:18:55 +01:00
jean-pierre charras a6a39cb842 Gerber plotter: Non horiz or vertical oval pads: better plot output:
These pads were plotted as a segment. This is not the right way:
Pads must be flashed or plotted as regions, not painted.
They are now plotted as Gerber regions round rectangle pads.
These regions are similar to flashed pads.

From Master branch, commit de7154e8e.
2020-04-02 19:50:59 +02:00
jean-pierre charras 1057eceb2f Gerber plotter: plot round rectangle pads using a region with arcs.
Previously, the region was a usual polygon with arc approximated by segment.
Using a region with arcs is a better way because it allows CAM tools to
identify this region as a round-rect pad.

Similar to master branch, commit 9cb3333d05.
2020-03-22 08:31:25 +01:00
jean-pierre charras 2c7ab3a28e Pcbnew, Gerber output: always generates Aperture Attributes.
Previously, for historical reasons, they were added only if
Include Netlist Attributes option was on.

But Aperture Attributes have nothing to do with Netlist Attributes, and good
Gerber files must include them.

From master branch
2020-03-12 17:00:55 +01:00
jean-pierre charras 3cc3c1bbd3 Zones: fix a crash when adding a zone cutout to a zone having already holes
From master branch
2020-03-12 14:49:36 +01:00
Jon Evans a70cf464d6 Check if scaling factor has changed when top-level window is moved
Fixes #2592

(cherry picked from commit 712ae5a953)
2020-02-23 15:55:05 -05:00
Jon Evans 546260348d Rework window size and position fixing code
Fixes #2624
Fixes #3888

(cherry picked from commit 96da45f12f)
2020-02-23 15:55:05 -05:00
jean-pierre charras 6b78fdf822 LOCALE_IO: replace the call to setlocale by a call to wxLocale to switch to "C" locale.
Previously we call only setlocale( xx, "C" ), but it was not enough on Windows.
Now we call wxLocale("C")
wxLocale calls setlocale, but also make some others initialization in wxWidgets.
It fixes some issues related to comma versus point as fp separator.
Especially wxWidgets warnings are no longer thrown, and a one case of incorrect
conversion is fixed.
However, wxLocale( "C" ) also switches the current translations to English, so
loading files can have a slightly different behavior
2020-02-17 09:14:18 +01:00
Jon Evans 3cb326e426 ADDED: Expose GetBuildVersion and GetBuildDate to Python
(cherry picked from commit 8fb72d8290)
2020-02-15 09:59:43 -05:00
Drew Fustini e35328fece Update copyright year in About dialog to 2020
(Cherry-picked from f359892de3)
2020-02-04 21:42:23 +00:00
jean-pierre charras 3af1e75084 Gerber plots: Add initial G01 command to the header,
to ensure linear interpolation mode.
To avoid issues, an interpolation mode must be set before first D01 command.

From master branch.
2020-02-03 17:56:02 +01:00
Ian McInerney cb711a648f Fix layout in color dialog on GTK
Don't initially set the minimum widget size, and instead let it be
computed at launch.

Fixes #2617

(Partial cherry-pick of 4f82939384)
2020-02-02 15:40:42 +00:00