1012 Commits

Author SHA1 Message Date
Seth Hillbrand
de26550b5a Add stubs for compiling 2025-09-10 21:23:37 -07:00
Jeff Young
2f1a91279f Make sure DRC inspection dialogs come up in front
of DRC dialog.
2025-09-10 17:52:09 +01:00
John Beard
1e272ca21b Geom: use SHAPE_SEGMENT for OVAL
OVAL didn't do anything SHAPE_SEGMENT couldn't already do.
2025-09-02 17:38:26 +08:00
jean-pierre charras
5b31b11731 SHAPE_RECT: add Normalize method to assure width or height > 0
ROUNDRECT: add option to normalize the rectangle on creation

if the created rectangle has a negative size(width or height) there are issues
when drawing it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21613
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21610
2025-09-01 11:56:56 +02:00
Seth Hillbrand
c6c8e19e39 The smallest angle between two segments is 0-180
Not 0-90.  Subtracting 180-angle and then taking the smaller of angle
and 180-angle will always get you 90 or less.  But obtuse angles are not
< 90
2025-08-31 11:49:41 -07:00
Jeff Young
67feb2e139 Performance tweaks. 2025-08-30 17:45:49 +01:00
jean-pierre charras
6592c75345 fix issues in ROUNDRECT. This also fix a change commit by mistake in aeafbe48
Fix incorrect ROUNDRECT Ctor. It also fixes a link issue on msys2
- Do not throw  an error in CTor: this is not the place. It is much easy to
fix the value of incorrect radius.
Moreover, the Ctor is called without catching a throw-ed error in code.
- fix the test about radius validity, broken.
2025-08-30 17:35:26 +02:00
jean-pierre charras
aeafbe48fe Step exporter: fix overzealous validity test.
When converting poly shapes with arcs in STEP_PCB_MODEL::MakeShapes,
when an error happens, a second try is made using a full polygonal shape.
However a fatal error was emitted at the first attempt, before the second try.
Now at first try, only a debug message is emitted on error. The fatal error
is emitted only if the second try fails.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21589
2025-08-30 12:58:56 +02:00
Seth Hillbrand
8acf5c1a25 ADDED: Rounded Rectangles
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4742
2025-08-29 17:37:30 -07:00
Seth Hillbrand
50274352b1 Skip exterior segments when splitting
We need to avoid fracture points when choosing how to split exterior
segments
2025-08-29 15:50:34 -07:00
Seth Hillbrand
408e1feae2 Fix Chessboard splitting
Due to a bug(?) in Clipper2, 45° collinear edges may not be detected.
See https://github.com/AngusJohnson/Clipper2/issues/1008 for current
status.  In the meantime, we pre-process these to remove the extraneous
joints preventing our triangulation from getting mixed up

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18176
2025-08-27 15:00:58 -07:00
Adrián García
46084c04b9 pcbnew: avoid missing or wrong lines inside hatched fill polygons
Avoid considering duplicated intersections between a segment of the
hatched fill and the polygon outline or vertices.
Also, check whether the segments of the lines are inside or outside
the polygon, so no lines are drawn outside when the shape is complex.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20450
2025-08-26 16:47:26 -07:00
Jeff Young
537ea6ee0c Move assignment operator for TRIANGULATED_POLYGON. 2025-08-25 20:48:37 +01:00
Seth Hillbrand
206dfa2883 Allow scaling grouped graphics in pcbnew
Adds scaling handles and editpoints to drag shapes larger/smaller while
maintaining proportions.  Future additions might include non
proportional scaling

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13072
2025-08-22 20:04:38 -07:00
Ian McInerney
c87211e1df Move Poppler library inclusion to the kiplatform library where it is used 2025-08-18 15:35:59 +01:00
Seth Hillbrand
a93803cfd7 Properly gate printing.cpp 2025-08-18 05:14:08 -07:00
Seth Hillbrand
bce3e7340f Revert "Rework Apple printing to better handle rotation"
This reverts commit 35ac6bdeb450fe1acc3c12d4f09ec9badd7af7f2.
2025-08-17 07:47:16 -07:00
Seth Hillbrand
35ac6bdeb4 Rework Apple printing to better handle rotation
Apparently, mixed orientation isn't a thing in normal Apple print but
can be handled by the PDFKit printing
2025-08-17 07:07:29 -07:00
Seth Hillbrand
98a8f8678a Add logging to Windows print functions 2025-08-17 07:07:13 -07:00
Seth Hillbrand
23c1a68da8 Make printing consistent with plotting.
How you ask?  Plot first -> then read the PDF and print directly to the
platform-specific printers.  Roundabout?  Yes.  Better than wx printing?
Darnbetcha.

Also allows multi-size page printing and proper margins and print
preview

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1831
2025-08-16 20:07:45 -07:00
Seth Hillbrand
188ffda029 Add a 90°-only mode for polygon creation
Sometimes, you don't want those 45° corners in your nice, clean zones.
This adds an additional mode that can be selected, cycling through
free-angle, 45° angle and 90° angle constraints
2025-08-12 16:48:36 -07:00
Seth Hillbrand
b207ec8817 Remove negative index access from CPoint
Callers should be responsible for index count and/or use iterators
2025-08-08 10:46:45 -07:00
Andrzej Wolski
c73d555fe2 ADDED: Lasso selection in pcbnew
Adds a lasso or freeform selection tool to KiCad in addition to standard
rectangular selection.  Adds supporting HitTest routines

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/1977
2025-08-06 16:06:40 -07:00
Seth Hillbrand
1306cb337d Fix fat-fingering mistake 2025-08-06 13:26:20 -07:00
Seth Hillbrand
7dc83fbffd Ensure dialogs are visible on all Spaces
We never want to hide dialogs if their parent is on a different Space
(MacOS-specific terminology), so set the window property to show
everywhere when showing a dialog

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13906
2025-08-06 11:48:07 -07:00
Jeff Young
d3f2bec6a6 Performance tweaks. 2025-08-05 13:49:31 +01:00
Jeff Young
724e44d5a0 Move assignment operators for some hot-path classes. 2025-08-04 19:11:59 +01:00
Seth Hillbrand
50c7aff3ff Simplify KiROUND using std::llround/clamp
Removes the bespoke rounding in favor of std::llround and std::clamp
routines
2025-08-04 09:26:25 -07:00
Seth Hillbrand
4aa2047f45 Replace alg::delete and alg::delete_if with std c++20 2025-08-04 09:03:16 -07:00
Seth Hillbrand
4221c1d93b Additional speed-up for outlines and fills
BBOX check before polgon point inside
Clean representation of segment iterator
Pre-allocate line chain space
2025-07-22 13:38:39 -07:00
Seth Hillbrand
2aeecec9bd Remove Creepage generation from reporting
Recalculating creepeage every time we reported a new clearance error was
unneccesarily complex.  Since the clearance errors are always straight
lines, we just need to calculate the closest approach and present that
segment
2025-07-21 14:10:34 -07:00
Seth Hillbrand
4c03ab8ebb Finally remove other_math routines
Replace with standard SEG and VECTOR2 alternatives.  Add QA test for
additional SEG-line intersection routine
2025-07-21 11:03:17 -07:00
Seth Hillbrand
0459c54a92 Cleanup and clarify SEG::intersect and SEG::Collide
Fix handling of end point intersection case
Fix degenerate handling
Fix overflow cases
Simplify logic in SEG::Collide
Remove overly simplistic check for intersection

Add multiple QA regression tests
2025-07-21 11:03:17 -07:00
Jeff Young
caf6e23064 Fix m_importProperties not getting nulled (KICAD-6BJ). 2025-07-14 13:17:53 +01:00
Jeff Young
5b91a24380 Retire WINDOW_FREEZER in favour of wxWindowUpdateLocker.
Also pulls out previous fix to a Sentry issue I can
no longer find, at least until I figure out what
went wrong.
2025-07-11 13:21:04 +01:00
Jeff Young
53c90b0469 Upgrade ShowPlayer re-entrancy guard (KICAD-XAC). 2025-07-10 17:54:42 +01:00
jean-pierre charras
76c2a9fb8e Fix mingw build 2025-07-10 08:02:00 +02:00
Mark Roszko
743988bd57 Add support for SHAddToRecentDocs on windows with app model id 2025-07-09 20:12:30 -04:00
jean-pierre charras
d0288dbcbf Windows, msys2 build: fix cast not accepted by GCC 2025-07-09 12:45:45 +02:00
Mark Roszko
572d394be7 Fix shift+middle click on windows no longer working
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21267
2025-07-08 23:17:46 -04:00
Jeff Young
f589ed906f Collect more debugging. 2025-07-08 09:42:19 +01:00
Jeff Young
c960f69a9b Equality for doubles. (Potentially KICAD-SV8) 2025-07-06 21:57:23 +01:00
Mark Roszko
1696d75471 Provide custom coloring for Control Light / wxSYS_COLOUR_3DLIGHT 2025-06-14 15:57:23 -04:00
Mark Roszko
b83f433506 Enable dark mode on windows when built with wx 3.3 2025-06-14 13:55:02 -04:00
Jeff Young
307f3c17bc Revert div-by-0 fixes which fail arc regression tests. 2025-06-09 20:09:24 +01:00
Jeff Young
c5a053d51c Div-by-0 safety. 2025-06-09 12:54:30 +01:00
Jeff Young
265d273f93 Negative number safety. 2025-06-08 16:33:04 +01:00
John Beard
d15b2b7305 SHAPE_ARC: Fix GetCentralAngle normalization documentation
This appears to have always been [-360 .. 360], as some tests in
test_shape_arc.cpp have had negative values for a very long time.

Add tests on the start, end and central angle accessors to enforce
the documented normalizations.
2025-06-08 09:55:54 +08:00
Jeff Young
31c6c28882 Performance optimizations. 2025-06-06 18:25:20 +01:00
Marek Roszko
54780ae0d4 Fix nuisance warning about unreachable return 2025-06-05 21:29:54 -04:00