Commit Graph

3624 Commits

Author SHA1 Message Date
jean-pierre charras 39c38fb386 Fix a side effect of our LOCALE_IO by using setlocale( LC_NUMERIC, "C" ) instead of setlocale( LC_ALL, "C" ) LC_NUMERIC is the right option to use in LOCALE_IO because only the floating point separator must be modified When using LC_ALL, the Env var expansion wxGetEnv() was not working when the env var contains non ascii7 codes after a call to LOCALE_IO. When using setlocale( LC_NUMERIC, "C" ) in LOCALE_IO, wxGetEnv() works fine.
Fixes: lp:1795990
https://bugs.launchpad.net/kicad/+bug/1795990
2018-10-07 16:27:47 +02:00
jean-pierre charras 99f25b0895 Opengl fix: bitmaps having a width not multiple of 4 were incorrectly drawn.
This fix draws a "sub bitmap" having a width multiple of 4.
(The loss of 1 to 3 pixels in horizontal size should be not really noticeable)

(cherry picked from commit 3a02e54411)
2018-10-06 07:22:38 -07:00
Tomasz Wlostowski a43ec3e3f0 OPENGL_GAL: optimized JP's bitmap drawing function to use textures
(cherry picked from commit 516cf47946)
2018-10-06 07:22:38 -07:00
jean-pierre charras 7b596f0365 GAL canvases: add DrawBitmap(), using a basic brute force algo for OpenGL, and a optimized code for Cairo. In this fix the brute force means draw each pixel as a rectangle. It works fine, but could be optimized.
(cherry picked from commit fefc7b8172)
2018-10-06 07:22:38 -07:00
jean-pierre charras 51a74b53cb Pcbnew: Crash after running external plugin Happens only in Opengl mode. So enforce controls in 3 group function: DrawGroup, ChangeGroupColor, ChangeGroupDepth.
Fixes: lp:1795044
https://bugs.launchpad.net/kicad/+bug/1795044
2018-09-29 14:19:07 +02:00
John Beard f591f8741a Prevent segfault when undoing or resetting non-hotkey rows
This is caused by:

* Not checking the hotkey data is not null when performing a
  hotkey action
* Allowing hotkey actions on non-hotkey rows.

This fixes both of these, and adds an assert to warn if someone
does manage to fire a hotkey action on a non-hotkey row (but it
won't crash).

This is a ported version of commit 704615721 on the master branch.

Fixes: lp:1794756
* https://bugs.launchpad.net/kicad/+bug/1794756
2018-09-28 10:20:53 -04:00
Jeff Young 04e699f789 Show pads when parent footprint is selected.
Fixes: lp:1670090
* https://bugs.launchpad.net/kicad/+bug/1670090

(cherry picked from commit 66848b9334)
2018-09-24 06:38:52 -07:00
Seth Hillbrand 9e355c29f1 Removing OpenMP
This commit finishes the removal of OpenMP from the KiCad codebase.
Removed in this commit are the OpenMP calls in 3d-viewer and
qa/polygon_triangulation as well as all references in CMakeLists.txt

std::thread is used instead for multithreaded computation
(cherry picked from commit f8784f30a8)
2018-09-24 06:38:52 -07:00
Jeff Young 1820e81f5e Don't allow drawing to a zero-height or zero-width GAL canvas.
Fixes: lp:1793913
* https://bugs.launchpad.net/kicad/+bug/1793913

(cherry picked from commit 0309228276)
2018-09-22 22:10:49 +01:00
Seth Hillbrand 48b4a897af pcbnew: Limit zone simplification
Commit 73c229714 was a bit of a sledgehammer for the associated problem
of degenerate points.  This commit replaces that one by only performing
additional simplification of the zone polygons on those polygons that
fail our initial triangulation attempt.

(cherry picked from commit 3ebba6cbe1)
2018-09-20 10:12:30 -07:00
Seth Hillbrand 4c409fbac9 triangulation: Fracture/Simplify all polygons
Calls the simplify/fracture polygon code on any polygon prior to
tesselation.  This avoids issues with degenerate polygons where the
degenerate points are not sequential.

Fixes: lp:1790534
* https://bugs.launchpad.net/kicad/+bug/1790534

(cherry picked from commit 73c2297144)
2018-09-20 10:12:30 -07:00
Seth Hillbrand 4560d4ef69 Replacing Tesselation
Replaces Poly2Tri with updated code to process polygons faster and more
robustly.  Notably, we can now handle overlapping holes in the polygons,
allowing us to cache the triangulation of complex boards

(cherry picked from commit a6325aab29)
2018-09-20 10:12:30 -07:00
Jeff Young 3a03c79255 Double opening speed of PCBs with ground and/or power planes.
(Or any other boards with complicated zones.)

(cherry picked from commit 7c04d8be1c)
2018-09-20 09:49:48 -07:00
Seth Hillbrand a454adb3ba rename lang_chinese -> lang_zh
This is a 5.0 fix only.  Can't cherry pick from 5.1 as this was part of a
larger commit to unify preferences dialog
(7841f8a466)
2018-09-17 10:39:38 -07:00
Wayne Stambaugh 0ff84865ca Update translators list to include simplified Chinese translator. 2018-09-17 11:53:55 -04:00
Alexey Chernov a84de7cccf Adding OpenSSL include directory explicitly
Fixes: lp:1791164
* https://bugs.launchpad.net/kicad/+bug/1791164

( cherry-picked from 3ad1cd8d5 )
2018-09-10 07:18:18 -07:00
Seth Hillbrand b987126b7d pcbnew: Keep Yes/No dialogs above the windows
Modal yes/no questions should not be allowed to fall behind other
windows.  They need to be answered before the program continues and
clicking outside of the dialog should not hide dialog itself.

Fixes: lp:1790640
* https://bugs.launchpad.net/kicad/+bug/1790640
2018-09-08 20:18:02 -07:00
qu1ck f0e9e3b9d5 Extend swig definitions to contain SHAPE_LINE_CHAIN and VECTOR2I 2018-08-31 13:16:13 -04:00
Seth Hillbrand 20ea486378 GAL: Add a selected item layer
The selected items should be displayed above the rest of the items but
below informational overlays.

Fixes: lp:1789505
* https://bugs.launchpad.net/kicad/+bug/1789505
2018-08-28 14:58:37 -07:00
Jeff Young 3c87ab94a2 Fix fast grid switching for OSX and Footprint Editor.
Fixes: lp:1787066
* https://bugs.launchpad.net/kicad/+bug/1787066
2018-08-26 19:01:40 +01:00
Jeff Young 8cb389d95c Use actual parent for dialogs; don't pass nullptr.
Fixes: lp:1788962
* https://bugs.launchpad.net/kicad/+bug/1788962
2018-08-25 11:12:58 +01:00
Jeff Young 7e2e39ce30 Handle separate parsing rules for ID_SCH and ID_PCB.
This removes the existing constructors so that all parsing must
be explicit and callers are made aware that they need to think
about illegal characters, malformed ids, etc.

Fixes: lp:1783474
* https://bugs.launchpad.net/kicad/+bug/1783474

Fixes: lp:1786819
* https://bugs.launchpad.net/kicad/+bug/1786819
2018-08-24 23:57:19 +01:00
jean-pierre charras dc022dcdae key event in draw_panel.cpp: fix incorrect behavior for the escape key (the key was handled but the evnent was skipped). This create an incorrect behavior because the event key was resend because the primary event was seen as not handled by the drawpanel. 2018-08-21 18:49:08 +02:00
jean-pierre charras e2c6422838 Better fix for accelerator menus using "Back" (previously named "BkSp") key
Use the wxWidgets official accelerator key string for WXK_BACK (this is "Back") in menuitems instead of "BkSp"
Also when reading the hotkey config file, avoid to set a hotkey to unassigned when its name is not found in list.
The default value is used.
Unassigned hotkey use <unassigned> as key name (and 0 as key code) in file.
2018-08-21 18:49:08 +02:00
jean-pierre charras 831978293f Fix ASCII code used in accelerator menus for BkSp key (Linux only)
On Linux (GTK?) the accelerator key BkSp, when used in menus must be coded as "\t\b" and not "\tBkSp".
However, On Windows, it must be "\tBkSp".
Joys of multi-platform development.
2018-08-15 21:19:41 +02:00
Seth Hillbrand edbf34c2b2 Adjust RTree default floating point to use double
This reverts the previous work-around 7d62f14dd for the RTree splitting
degeneracy that was placed prior to v5.  It appears not to have worked
for all systems.  In its place, we use doubles instead of floats to
calculate the bounding box when filling the RTree.  This keeps maximum
volume items from overlapping with the system boundary in test cases.

(cherry-picked from 539ca5aa3)
2018-08-06 17:01:59 -07:00
Jeff Young 9230189f62 Fix thread-safety issue with some global wxStrings.
These cause intermittent crashes in footprint loading.  See
comments in code.

(cherry picked from commit 5e8e2570ba)
2018-08-06 13:52:23 +01:00
Jeff Young 80e7a83fb0 Generalize OSX &Cancel fix to work for other languages.
Fixes: lp:1784350
* https://bugs.launchpad.net/kicad/+bug/1784350

(cherry picked from commit 98849bde96)
2018-08-01 11:50:04 +01:00
jean-pierre charras d2aa976017 Fix many wxWidgets alerts, to avoid useless bug reports when kicad is compiled in Debug mode 2018-07-31 11:41:47 +02:00
Maciej Suminski d63c1a2118 Use quoted file name when opening a PDF file
Fixes: lp:1783667
* https://bugs.launchpad.net/kicad/+bug/1783667

(cherry-picked from bbfc1eb1)
2018-07-26 12:07:46 +02:00
Maciej Suminski 4ff426275f Fixed KIDIALOG freeze
wxDialog calls Show(false) when the dialog is about to be closed, but
KIDIALOG::Show() implementation did not forward the show parameter to
wxRichMessageDialog::Show() invocation. As the parameter was not
specified, the mentioned Show() call always used 'true' as the default
parameter, preventing the dialog from being closed.

Fixes: lp:1782999
* https://bugs.launchpad.net/kicad/+bug/1782999

(cherry-picked from commit 39d8d143)
2018-07-25 12:10:54 +02:00
Carsten Schoenert e81faa2d5f fix misspelled 'allow to' -> 'allow one to' 2018-07-11 10:35:14 -04:00
Carsten Schoenert 9f7109826d fix misspelled 'allows to' -> 'allows one to'
Fixup small grammar issues around used 'allows to ...' almost in
code comments.
2018-07-11 10:35:03 -04:00
Carsten Schoenert 9a13dd48af fix misspelled 'Toogle' -> 'Toggle'
A small typo fixup for misspelled word Toogle.
2018-07-11 10:34:53 -04:00
Martin Aberg 9b1f2447b6 fp_lib_table: explicit assumption by assert
This commit makes an implicit assumption explicit by describing it with
an assert.

Fixes lp:1778426

https://bugs.launchpad.net/kicad/+bug/1778426
2018-06-29 19:36:58 -04:00
Seth Hillbrand 4af699e919 hotkeys: Don't import v4 hotkeys automatically
Hotkey options have shifted some options from context-specific to global
hotkeys.  This causes conflicts with old hotkey definitions.  Instead,
we keep the v5 eeschema/pcbnew hotkeys completely separate.  Users can
still import their custom hotkey files from v4.

Fixes: lp:1778408
* https://bugs.launchpad.net/kicad/+bug/1778408
2018-06-29 11:20:11 -07:00
Simon Richter d3deaf5ff5 Rewrite test for valid characters in names
The ternary operator decays array arguments to pointers, so they can no
longer be assigned to array references.
2018-06-29 09:42:10 +02:00
Seth Hillbrand 76f151b4d8 Fix issue with prev d83cff63f
Corrected the new/delete idiom
2018-06-27 16:40:57 -07:00
Seth Hillbrand d83cff63f6 fix memory leak
When staging a commit for an object that has already been modified,
there is a Clone() made for the hypothetical entry.  We need to free it
if we are not storing a new entry.
2018-06-27 16:15:27 -07:00
Seth Hillbrand d30ac2967a eeschema: Rescue symbols with illegal chars
When parsing component names, we need to account for the possibility of
illegal characters (e.g. "/", ":") in the names from v4 libraries.  They
are fixed internally by the cache parser but if we don't fix them
in the rescue routine, the symbol won't match it's cache name.

This standardizes all schematic illegal character routines into LIB_ID

Fixes: lp:1774774
* https://bugs.launchpad.net/kicad/+bug/1774774
2018-06-27 14:15:30 -07:00
Maciej Suminski f10aa6c857 Use paths relative to the executable on Windows
Paths based on DEFAULT_INSTALL_PATH do not work on Windows,
as in fact there is no default install path, as in case of Unix-based
systems. In such case, the initial paths point to mingw subdirectories
that normally do not exist on user machines.

The patch changes the initial path values to make them relative to
the executable and follow the current Windows installer scheme.

Fixes: lp:1775796
* https://bugs.launchpad.net/kicad/+bug/1775796
2018-06-27 11:02:48 +02:00
Andrzej Wolski 1f6f76beb9 Fix overbar drawing for non-italic text
Overbar was always indented inward, regardless if text was italic or not.
2018-06-24 12:01:10 -04:00
Maciej Suminski 73a8d2a9d5 OPENGL GAL: Fixed the iteration condition when drawing triangulated polyset
The loop used an incorrect variable size as the loop limit,
occasionally causing out of bounds accesses.

Fixes: lp:1778288
* https://bugs.launchpad.net/kicad/+bug/1778288
2018-06-23 02:05:21 +02:00
Maciej Suminski 1751e4631c Code formatting 2018-06-23 01:59:49 +02:00
Andrzej Wolski a7cd62ad12 Save through hole pads color to config file
TH Pads color is now user settable, so should be saved in config file.
2018-06-22 11:34:56 -04:00
Seth Hillbrand a1ef441dd9 origin viewitem needs to account for size zoom
The origin item doesn't have a fixed size.  It is constant on the screen but
changes the effective BBox size based on the zoom level.
But we can't simply set it to the maximum size as this causes a splitting degeneracy
when compiling for Debian i386.  By modestly adjusting the bbox, we avoid the degeneracy
while keeping the origin visible at all zoom levels

Fixes: lp:1777379
* https://bugs.launchpad.net/kicad/+bug/1777379
2018-06-20 12:08:57 -07:00
Wayne Stambaugh 8394e2b71e Fix broken LIB_ID library nickname illegal character tests.
During the symbol library table implementation, the legal character
tests for the footprint library table were changed and the forward
slash '/' character became illegal.  This change broke editing some
users footprint library tables that already had '/' in library table
nicknames.  This change split the library nickname and library item
name illegal character tests.
2018-06-20 14:36:40 -04:00
Jeff Young 79e0bb08d0 Architecturally-simpler fix for grid context menu unit changes.
Fixes: lp:1777519
* https://bugs.launchpad.net/kicad/+bug/1777519
2018-06-20 16:54:24 +01:00
Maciej Suminski 44337dec56 pcbnew GAL: Fix bouncing zoom on mouse wheel scroll in Windows
Handling wxEVT_SCROLLWIN_LINE{UP,DOWN} executes the scroll event handler
too many times causing zoom bounces.

Fixes: lp:1562173
* https://bugs.launchpad.net/kicad/+bug/1562173
2018-06-20 16:55:14 +02:00
jean-pierre charras f52763f22b Legacy canvas: fix issue when zooming in/out using mousewheel: slightly shifts screen up/down.
It happens only when the 'warp and center cursor on zoom' option is disabled.

Was created after modifying the code in EDA_DRAW_FRAME::AdjustScrollBars(),
making EDA_DRAW_FRAME::RedrawScreen2() not working very well.

(partial fix of bug 1562173)
2018-06-19 19:53:00 +02:00