Commit Graph

4300 Commits

Author SHA1 Message Date
Seth Hillbrand fcaf11422a Fix bitmap clipping
When printing (using DC context) the bitmap will clear the full screen
unless the clipping region is set to the image itself.

Addresses KSC ticket 126

Fixes #1877 | https://gitlab.com/kicad/code/kicad/issues/1877

(cherry picked from commit 195c3d074b)
2020-01-11 10:00:57 -08:00
jean-pierre charras 683c01b301 SVG plotter: fix an issue with mirrored texts. Mirrored texts have a size < 0. Of course, the actual value for the plotter is the absolute value. 2020-01-09 18:24:15 +01:00
jean-pierre charras e2492f773d FILENAME_RESOLVER: fix missing conversion from UTF8 to wide chars.
Fixes #3742
https://gitlab.com/kicad/code/kicad/issues/3742
2020-01-08 10:47:14 +01:00
Ian McInerney eeeb4596c3 Properly escape spaces when opening PDFs on windows
Fixes https://gitlab.com/kicad/code/kicad/issues/2625

(cherry-picked from 20e7fc8a0e)
2020-01-03 19:09:04 +00:00
jean-pierre charras 23853cae14 Try to fix SEG::PointCloserThan(), not working for quasi H or V segments.
Quasi H or V segments are segments having the same x value or y value
(with a + or -1 max diff) for end points coordinates.
The change is a workaround, not really a fix.

Fixes #3711
https://gitlab.com/kicad/code/kicad/issues/3711
2019-12-31 15:59:45 +01:00
jean-pierre charras 8c03d1bdde Gerber files: update unicode coding to the 2019 06 Gerber specifications.
In gbr files, not allowed chars are coded using a 16 bit (4 hexa digits)
unicode sequence.
Previously, it was \XXXX and now is \uXXXX escape sequence.

Changes from master branch.
2019-12-27 20:03:01 +01:00
Jon Evans ef80642dec LSET: Prevent assertion in MSW when size is not a multiple of 4
(cherry picked from commit 2ea565473f)
2019-12-26 10:01:44 -05:00
Mark Roszko 35d3f1f72a common: Remove out of bounds and erroenous array access
(cherry-picked from bf32122134)
2019-12-19 11:35:21 +00:00
jean-pierre charras 0f8747e194 Gerber plotter: modify G02 and G03 commands.
They are now in a specific block and no longer combined with an other
command.
(combining these commands with an other command (D01 or D02) is deprecated)

Fixes #3677 | https://gitlab.com/kicad/code/kicad/issues/3677
2019-12-18 12:30:28 +01:00
Ian McInerney 93f16ba9e3 Update about dialog link to GitLab
(cherry-picked from c31c99abd1)

Fixes #3687
2019-12-17 20:21:59 +00:00
Seth Hillbrand dbfaf568fc Plot SVG embedded
ADDED: embedded image support for SVG files

Fixes #3643 | https://gitlab.com/kicad/code/kicad/issues/3643

(cherry picked from commit fa133f3f5c)
2019-12-08 08:59:01 -08:00
Jeff Young c69080f11e Fix some issues with the previous commit. 2019-12-02 23:33:45 +00:00
Jeff Young 5a48c800ee Make sure that libraries are always sorted consistently.
Fixes #1847481 | https://gitlab.com/kicad/code/kicad/issues/1847481
2019-12-02 21:55:31 +00:00
jean-pierre charras 3827c16fde Fix a wxWidgets alert 2019-11-20 10:02:09 +01:00
jean-pierre charras 37b6552c42 FIX: add parameter to GAL::DrawCurve to control the curve to polyline
conversion.
Cairo supports curves, but not Opengl, that needs a conversion to polyline.
This control allows optimization in conversion
2019-11-17 18:22:13 +01:00
jean-pierre charras 1903052d79 Bezier curves: replace previous algorithm to convert the curve to segments.
In some cases it was not working well.
Opengl was using an other algo (using the curve properties to create segments)
Now only the OpenGL algo is used,
with optimization to reduce the number of segments.
2019-11-17 18:22:13 +01:00
jean-pierre charras e04d82e940 Gerber plot: minor fixes in TO object attributes.
Gerbview: remove a outdated warning about RS274D format.
2019-11-05 14:25:30 +01:00
Seth Hillbrand b67acd5ea1 pcbnew: Fix 45° snapping polygons
The constrained draw was constraining the polygon size to fit the
existing points rather than extending the existing points to fit the
user's intent.

This adds a 90° double-joint for the completion polygon that allows the
user to complete common constrained polygons visually based on the
preview with a double-click to finish.

(cherry picked from commit bae50fab9f)

Fixes: lp:1849299
* https://bugs.launchpad.net/kicad/+bug/1849299
2019-10-24 16:05:27 -07:00
Seth Hillbrand 5e2721d2f5 Increase visibility of polygon preview
This set the polygon preview item to wider size and adjusts the draw
order to ensure it remains visible even when antialiasing

(cherry picked from commit ea1c8525ce)
2019-10-24 16:05:12 -07:00
jean-pierre charras 2cd43aee0a Gerber output: fix some (minor) issues related to attributes when plotting polygonal pads.
rect (when not horizontal or vertical), trapezoid and custom shapes are draw as polygons.

The dummy pad used to give attributes is removed, and TO attributes are used in Regions (polygons in Gerber dialect)

This is due to some modifications in Gerber format since the attributes are added in Kicad.
2019-10-24 09:32:40 +02:00
jean-pierre charras e54ea90607 PROGRESS_REPORTER: fix serious bug in its DTOR: the DTOR was calling Destroy. But Destroy() in wxWidgets calls the DTOR.
It can create recursive calls of the DTOR.
2019-10-23 11:29:44 +02:00
Seth Hillbrand 322eb2b8a8 pcbnew: Commit polygon points to new constrained zone
Adds leader points if they are not already existing in the zone

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

(cherry picked from commit 2e1af66a2b)
2019-10-20 10:31:08 -07:00
Seth Hillbrand 2d1ea1618b pcbnew: prevent assert with first pt
Finding the pt-to-end intersection requires a segment, so check for
multiple points.

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

(cherry picked from commit 70c64d93e4)
2019-10-20 07:41:48 -07:00
Seth Hillbrand 50723d07a6 GAL: Use vector for stroke elements
deque structures have higher overhead than vectors.  Not usually
problematic, but with hundreds of thousands of characters each with only
a few strokes, the overhead becomes dominant.

(cherry picked from commit 6084614371)
2019-10-19 07:28:25 -07:00
Seth Hillbrand 1161562bc8 Remove Yahoo Groups link
Yahoo has discontinued its groups.

See https://help.yahoo.com/kb/groups/SLN31010.html
2019-10-17 15:59:06 -07:00
Seth Hillbrand e5463330ef view: Check for viewData in IsVisible()
viewData can be NULL, make sure we verify it before dereferencing.

(cherry picked from commit 5b8661f2ab)
2019-10-15 09:46:47 -07:00
jean-pierre charras d6db6dedca Gerber file export: avoid duplicate corner when creating polygons (regions in Gerber dialect)
Fixes: lp:1847714
https://bugs.launchpad.net/kicad/+bug/1847714
2019-10-11 21:01:40 +02:00
jean-pierre charras 6506f77689 Gencad export: fix an issue in hash_eda calculation,
that can generate the same hash for 2 different footprints.
Therefore, for some footprints, the right footprint was not associated to the component.
The hash calculation was using a XOR to combine 2 sub hash values.
This is not a reliable way to combine these hash values.
They are now added.
Looks better to identify similar and different footprints.

Fixes: lp:1847575
https://bugs.launchpad.net/kicad/+bug/1847575
2019-10-10 20:20:45 +02:00
jean-pierre charras 7856061cf0 Fix a few wxWidget asserts related to not existing block operations from mouse drag command.
block rotate and block mirror are not implemented in HandleBlockPlace.
(only available from context menu)

Fixes: lp:1847554
https://bugs.launchpad.net/kicad/+bug/1847554
2019-10-10 10:07:15 +02:00
jean-pierre charras 41231e8ae2 Gerber file generation: fix incorrect aperFunction attribute for graphic items on edge cut layer.
Was NonConductor. Must be Profile.
From master branch.
2019-10-09 16:02:45 +02:00
Ian McInerney e618e34c94 pcbnew: Clean up extension handling in graphics plugins
* Fix wildcard display in the file selector dialog (on GTK
  it would show the regex to the user)
* Move the file extension comparison into a common function

(cherry picked from commit b33c3a5ad8)
2019-10-04 16:01:15 -04:00
Ian McInerney 69d0446019 Update pleditor path for run from build directory
(cherry picked from commit 3a2dbf7786)
2019-10-04 07:58:17 -04:00
jean-pierre charras 0bd0d57a81 Cairo print, on GTK: use a better DPI definition to avoid artifacts rendering (GTK specific) Previously, a 600 DPI was used to set device scale (can create minor visible rounding issues). Using now 4800 DPI to reduce these rounding artifacts.
Fixes: lp:1845229
https://bugs.launchpad.net/kicad/+bug/1845229
2019-09-27 11:17:58 +02:00
jean-pierre charras 9dd5b6ce37 simulator: plot curves: fix incorrect draw area limits calculation when zooming.
Fixes: lp:1674132
https://bugs.launchpad.net/kicad/+bug/1674132
2019-09-26 16:30:28 +02:00
Ian McInerney 2bd0bae2f7 Remove unneeded wxWidgets version checks in the code
Now that the minimum version is 3.0.0, we don't need to actually
check if the version is greater than 3.0.0 inside the code.

(cherry picked from commit a37d8f2859)
2019-09-18 14:27:30 -04:00
Jeff Young f1436cec9b Restore PointCloserThan() behaviour to really be "closer than".
Change calls which really want it to be "closer than or equal" to
distance + 1.

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

(cherry picked from commit 25fa2131d2)
2019-09-10 12:57:52 +01:00
Jeff Young 2278f40051 Fix zero failure in SEG::PointCloserThan().
Fixes: lp:1843329
* https://bugs.launchpad.net/kicad/+bug/1843329
2019-09-09 23:22:29 +01:00
Ian McInerney 18a76d3a87 Manually put the UNIT_BINDER text on the primary selection clipboard
The OnKillFocus handler of the UNIT_BINDER replaces the text in the
control with the evaluated string, which removes the selection. To
get the original text on the primary selection clipboard, we must
add it ourselves.

Fixes: lp:1794623
* https://bugs.launchpad.net/kicad/+bug/1794623
2019-09-09 09:02:23 -07:00
Jeff Young 6a65461ec7 Replace buggy code in TestSegmentHit() with call to SEG::PointCloserThan()
Fixes: lp:1843101
* https://bugs.launchpad.net/kicad/+bug/1843101

(cherry picked from commit 6f0d8c3eac)
2019-09-08 12:40:33 +01:00
Jeff Young a5a0a7c4f3 Fix bug with high-frequency plots.
Fixes: lp:1839712
* https://bugs.launchpad.net/kicad/+bug/1839712

(cherry picked from commit 2ac270ce8e)
2019-09-08 01:12:33 +01:00
Jeff Young 848873d87e Add some protection against newlines sneaking into the file.
Fixes: lp:1842943
* https://bugs.launchpad.net/kicad/+bug/1842943
2019-09-07 02:32:56 +01:00
Jeff Young 75bb864237 Workaround wxWidgets inability to find the default PDF viewer.
Fixes: lp:1843061
* https://bugs.launchpad.net/kicad/+bug/1843061

(cherry picked from commit d55f4d05b4)
2019-09-07 00:07:06 +01:00
Wayne Stambaugh 6d4dd3e17a Pcbnew: fix size of graphics import warning dialog.
Use the HTML_MESSAGE_BOX window to present the warning messages rather
than wxMessageBox which would overflow the display when there were a lot
of graphic items that could not be parsed.

Fixes lp:1839565

https://bugs.launchpad.net/kicad/+bug/1839565

(cherry picked from commit 24454f5105)
2019-09-06 14:59:40 -04:00
Ian McInerney 649c22a34e wxWidgets compatibility fixes
* Remove unneeded check
* Fix WX_GRID since upstream renamed a variable in 3.1.3

(cherry picked from commit 8d86d94a4d)
2019-09-06 08:48:03 -04:00
Jeff Young 1ed8912f57 Workaround an issue where a throw terminates (even when there's a catch for it).
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)
2019-09-01 12:37:58 +01:00
Seth Hillbrand fccce265aa pcbnew: Retain 45° constraint
This also finishes the polygon with 45° lines when chosen as a create
option.

Fixes: lp:1833673
* https://bugs.launchpad.net/kicad/+bug/1833673
2019-08-26 14:33:30 -07:00
Jeff Young dd8610fd5c Don't apply GTK fix to OSX as it causes a hang.
Fixes: lp:1841379
* https://bugs.launchpad.net/kicad/+bug/1841379

(cherry picked from commit de8f97be6b)
2019-08-26 00:50:54 +01:00
Seth Hillbrand efc0325e14 Handle wx scrollbar thumbs in system-independent way
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)
2019-08-22 10:16:25 -07:00
Seth Hillbrand 213547f545 SVG: Correct plot fills for arcs/polylines
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
2019-08-20 12:01:00 -07:00
Seth Hillbrand ebba15fe67 Alphabetize Library Table returns
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
2019-08-19 15:23:29 -07:00