Commit Graph

37862 Commits

Author SHA1 Message Date
Jeff Young 32626970a0 Prevent Sentry KICAD-MM crash.
It'd be nicer to know what happens, but we don't have a reproducible
case, so this "fix" will at least prevent that particular crash.

(cherry picked from commit 0091b9f897)
2023-06-10 10:57:14 +01:00
Jeff Young bc0a53a226 Increased mutex safety.
Don't even query the size() without having at least a shared_lock.

*May* prevent KICAD-4S, but seems unlikely.

(cherry picked from commit f3d3ade1dc)
2023-06-10 10:57:14 +01:00
Jeff Young b6a044111b Exclude redraws during closing (particularly of RATSNEST_VIEW_ITEM).
(cherry picked from commit 7a3a8b67c1)
2023-06-10 10:57:14 +01:00
Jeff Young 3c4286c98b Force re-word-wrapping of PCM package descriptions on Mac.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13328

(cherry picked from commit c7730eae3f)
2023-06-10 10:57:14 +01:00
Jeff Young 6d996e31b8 Don't dim SCH_FIELDs when selecting them.
(They were only getting drawn on top of the selection shadow when
drawn by their parent symbol because LIB_FIELD was correctly
setting the view layers but SCH_FIELD was not.)

(cherry picked from commit 2300b0d2a3)
2023-06-10 10:57:14 +01:00
Jeff Young ec4faad589 Don't allow setting a pad width or height of 0.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14278

(cherry picked from commit ddd2cb005b)
2023-06-10 10:57:14 +01:00
Alex 13820bc002 Support --mirror option in "kicad-cli pcb export pdf"
(cherry picked from commit 2450435131)
2023-06-10 04:58:07 +03:00
Alex 6ad9f25e7d Enable support for KICAD_SANITIZE_ADDRESS CMake flag on MSVC.
(cherry picked from commit d5edde799c)
2023-06-09 23:10:44 +00:00
Jeff Young a348fde7d1 Assertion checking for hole/parent ownership mismatch.
(This mismatch is the root of the problem in issue #14852.)
2023-06-10 01:05:00 +02:00
Tomasz Włostowski d25017dd5b router: can't add a clone of a VIA's hole when adding the via to INDEX - this will result in bogus colliding objects
This commit partially reverts deb3cbf8. VIA and SOLID operator='s introduced in it do a good job but the cloning of holes in addHole() causes bogus collisions.
2023-06-10 01:04:49 +02:00
Jeff Young 9b965f367a Prevent use-after-free crashes by not fighting over who owns a HOLE.
The diff-pair placer creates DIFF_PAIRs on the stack, which have
VIAs in them, which have HOLEs in them.  The HOLEs get put in the
NODE's index, and we then crash later when doing a collision after
the stack variable has gone out of scope.

The stack variable is also copied while doing a search for "best",
and without the operator= definitions the "best" and the "original"
both think they own the HOLE.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14852
2023-06-10 01:04:37 +02:00
Tomasz Wlostowski adca34ac6a router: invalidate items freed by PNS::NODE in the clearance cache
This was causing intermittent shove hiccups/freezes as RULE_RESOLVER::GetClearance() could return a bogus clearance value, taking
a cached value for an item that does not exist anymore. If the allocator/stack accidentally reclaimed such item's address - we were getting
very nasty and difficult to reproduce misbehaviours of the shove algorithm. Hopefully this patch fixes this. More info in the comments.

Note to self - I'm still not fully convinced I want PNS::ITEM pointers as the cache key, probably a unique counter would be better here.
2023-06-10 01:04:25 +02:00
Tomasz Wlostowski 51a4a92ec4 router: fix use-after-free crash in drag walkaround mode 2023-06-10 01:04:13 +02:00
Tomasz Wlostowski ae8ea3b938 router: correctly assign owner via/pad to its hole when committing the world state
fixes #14852
2023-06-10 00:27:38 +02:00
jean-pierre charras b57d77dd0b kicad-cli, STEP export: fix incorrect unit when user origin is specifed.
They are specified in mm (or inches), but must be stored in board units in code.
From master branch
2023-06-09 13:43:12 +02:00
Seth Hillbrand d5cbb56160 Fix builds for non-MSW 2023-06-07 08:26:27 -07:00
Seth Hillbrand e97c2a6864 Update Clipper2 to 9d946d7
Fixed a number of smaller issues as well as overlapping segment
cleaning.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14682

(cherry picked from commit fe62a3f985)
2023-06-07 08:22:47 -07:00
Marek Roszko 41447e9b44 Experiment with sentry breadcrumbs to footnote kiway events to provide more crash context
(cherry picked from commit 5b5176f104)
2023-06-07 11:02:23 +00:00
David Holdeman 7aa368c2c5 use same flag, fix inversion 2023-06-06 18:20:24 +00:00
David Holdeman 6a00eaa4a3 naively add option 2023-06-06 18:20:24 +00:00
Jeff Young 9240566167 Support shape collisions between SHAPE_POLY_SET and other shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14890

(cherry picked from commit 0f8c5a96b2)
2023-06-06 13:41:37 +01:00
Jeff Young 9eaa5f90e0 Replace larger text bboxes now that we're not using them for knockouts.
(cherry picked from commit 570978fa7f)
2023-06-06 11:19:41 +01:00
Jeff Young 214f785c97 Use rendered text to generate bounding box for knockout text.
Don't open-code knockout text shape generation in several different
places.

Make sure triangulated knockout text gets clearance added when
specified.

Collapse duplicated footprint text item plot routine (they're no
longer any different from plotting pcb text items).

(cherry picked from commit c71cf21e2f)
2023-06-06 11:19:41 +01:00
Jeff Young ae0534cbb4 Account for changes to mimic 6.0 text positioning in bounding boxes.
This is only a partial fix as knockout text is still busted....

(cherry picked from commit dacf0b2b96)
2023-06-06 11:19:41 +01:00
Jeff Young f3c5c458c6 Formatting.
(cherry picked from commit 6b0bff2f4f)
2023-06-06 11:19:41 +01:00
Marek Roszko d6fd5598ab Use the correct printf format for the move individually status text
Fixes sentry KICAD-1ZT


(cherry picked from commit b41606ecf7)
2023-06-05 13:55:52 +00:00
Mike Williams c41b334f0a LibTree: add numpad enter as enter
Written by Andrej Valek
2023-06-05 09:22:04 -04:00
Mike Williams c3a6bf3d40 UI: Add Numpad Enter as "Return" equivalent in missing places
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14244
2023-06-05 08:58:50 -04:00
Jeff Young cb7aa5143b Correctly handle hidden columns when pasting into grids.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14844

(cherry picked from commit f9fd37c4ca)
2023-06-04 21:24:35 +01:00
Jeff Young 8942abfc64 Handle through-hole via walls along with pads.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14757

(cherry picked from commit cb7f314f4b)
2023-06-04 21:22:37 +01:00
Jeff Young e5ef973d52 Trim solder paste (and other layers) to holes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8484

(cherry picked from commit b53bc1ae38)
2023-06-04 21:22:31 +01:00
Jeff Young 0bd45f691e Make sure 3D file browser is treated as modal by quit.
(Otherwise we crash when freeing it during the quit.)

(cherry picked from commit c36b0fcda7)
2023-06-04 21:22:19 +01:00
Jeff Young 117c70ed7d Don't double-up FUTURE_FORMAT_ERROR problem strings.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14780

(cherry picked from commit e82e4af483)
2023-06-04 21:21:18 +01:00
Jeff Young d09f88d53b Every time I search for SCH_TEXT* it doesn't work....
(cherry picked from commit b8986709bf)
2023-06-04 21:15:36 +01:00
Jeff Young 06f17d9415 Don't call OnPageSettingsChanges on Undo/Redo.
It's incredibly expensive (multiple seconds on a document with
lots of text in an outline font).

(cherry picked from commit 81d7428fd2)
2023-06-04 21:15:30 +01:00
Jeff Young c1d8e979f3 Spread the error-bar move evenly around justified text.
(cherry picked from commit 3ab9175553)
2023-06-04 21:15:22 +01:00
Jeff Young 16f286735d Cache LIB_PIN text extents for performance.
Also fixes a bug where we didn't triangulate at all when the char
count didn't warrant the likely overhead of spinning up a
thread_pool.

And fix another bug where EDA_TEXT::GetRenderCache() wasn't using
the given font.

Also reverts using the cache for drawing-sheet text.  The text
items are created from scratch from the data items each time
they're drawn, so there's never an existing cache to make use of.
Instead, we now check that the item is in the view, using a very
approximate bounding box generator (because even generating a
real bounding box shows up large in profiles).

And, lastly, fixes a bug where EndPos was never considered in
DS_DATA_ITEM::IsInsidePage().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14822

(cherry picked from commit f35a88ce0b)
2023-06-04 21:11:06 +01:00
Jeff Young 45c7490180 Outline font performance improvements.
1) Don't fracture font glyphs when generating them; we're going
   to fracture during triangulation anyway.
2) Don't check for self-intersection when deciding to fracture.
   It costs nearly as much as the fracture does.
3) Cache drawing sheet text.
4) Use the current font when checking for cache validity.
5) Parallelize glyph triangulation.
6) Don't invalidate bounding box caches when offset by {0,0}
7) Use the glyph cache when generating text effective shape.
8) Short-circuit NormalizeJustification() if its center/center.
9) Don't triangulate for GuessSelectionCandidates()
10) Avoid sqrt whenever possible.
11) Pre-allocate bezier and SHAPE_LINE_CHAIN buffers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14303

(cherry picked from commit 4ed267394a)
2023-06-04 20:57:14 +01:00
Jeff Young 1566b357cb Improve appearance of stroked knockout text.
(cherry picked from commit ff37ebe61a)
2023-06-04 20:56:05 +01:00
Seth Hillbrand 7d9222926a Connectivity: Correct alias-based bus resolution
Aliases in bus resolution were being resolved without a path, making
them effectively global nets.  This applies the corrected path to the
bus members and adds a QA to catch this error
2023-06-02 14:25:26 -07:00
Alex b957d5176e Fix view shifting when infobar is shown.
(cherry picked from commit df4fefeb20)
2023-06-02 18:07:48 +03:00
Jeff Young e76a520c19 Bug fixes for handling boolean flags in DRC rules.
(cherry picked from commit cb53a18ee3)
2023-06-02 00:20:11 +01:00
Jeff Young f0d205fed9 Don't use GetValueFieldText from within text var resolution.
(It resets the recursion checker.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14815

(cherry picked from commit 5114d3b8c3)
2023-06-02 00:17:35 +01:00
Marek Roszko 42811d0602 Fix blank symbol svg export file names
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14857


(cherry picked from commit c2d56eefb9)
2023-06-01 00:56:40 +00:00
jean-pierre charras b54c03f89e Cvpcb: the footprint viewer use the settings of pcbnew, and the code in _pcbnew.dll/so
So ensure they are loaded before creating the footprint viewer.
Fixes #14850
https://gitlab.com/kicad/code/kicad/-/issues/14850
2023-05-30 20:11:15 +02:00
jean-pierre charras 5596790a6e Symbol editor: ensure a new derived symbol has the correct DeMorgan option displayed.
Derived symbols use the same graphics as their parent, so ensure the parent is
used to enable/disable the DeMorgan option and tool in toolbar
Fixes #13739
https://gitlab.com/kicad/code/kicad/-/issues/13739
2023-05-29 20:41:35 +02:00
jean-pierre charras e55263be00 Pcbnew: fix crash when trying to save a board with a text with overbar and
using a non Kicad font
PCB_PLUGIN::formatRenderCache() was considering all shapes in cache are polygons,
but this is not true: some items can be stroke shapes.
From stable branch
Fixes #14804
https://gitlab.com/kicad/code/kicad/-/issues/14804
2023-05-29 20:41:35 +02:00
Wayne Stambaugh 441c2b50b9 Fix potential stale pointer bug in schematic highlight connection code.
SCH_CONNECTION objects are temporary and can become stale any time the
connectivity is updated.  Keeping them around to reference later is a
bad idea.  Even if the object pointer is still valid in an SCH_ITEM in
the undo/redo buffers, comparing the pointer against another pointer as
a test to see if they are the same connection is not valid.  Saving the
connection name is safe and ensures the connection is the same even if
the pointers differ.

(cherry picked from commit 831a6d55fc)
2023-05-29 13:55:07 -04:00
jean-pierre charras 0a3f5b65bf Fix last changes in io.cpp for msys2.
- use the same code for msys2 and msvc
- add an option to use a fallback for msys2 if the common code does not compile
2023-05-29 13:38:52 -04:00
Marek Roszko 93c29ad15e Add a sequential read flagged fopen helper
Trying to squeeze out some kind of gain by informing the OS we will read a file sequentially.
In particular our FILE_LINE_READER just uses fgetc until the end
2023-05-29 13:36:06 -04:00