162 Commits

Author SHA1 Message Date
Jeff Young
01f6776226 Fix hit-testing for rounded corner rectangles. 2025-09-08 18:37:47 +01:00
Jeff Young
ce140d8dfc Formatting. 2025-09-01 22:04:59 +01:00
jean-pierre charras
4610a49323 Fix round rect shape STEP export.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21599
2025-08-31 12:43:40 +02:00
jean-pierre charras
68f9b74ae9 SHAPE RECTANGLE: fix hatching clipping for round rectangle. 2025-08-31 10:05:21 +02:00
Jeff Young
be57c1a380 Fix undo for rounded rects.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21595
2025-08-30 21:16:47 +01:00
Seth Hillbrand
1a3f6028f8 Fix missed last points
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21596
2025-08-30 08:33:46 -07:00
Seth Hillbrand
fe4ddc66eb Limit radius in more places 2025-08-30 08:19:35 -07:00
Seth Hillbrand
0f1b514964 Handle corner radius in Create from selection
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21601
2025-08-30 07:33:30 -07: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
1df5ad0e4c Fix circle scaling
We scale the full circle, which is just defined by its points

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21551
2025-08-25 18:03:46 -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
Jeff Young
fde693ebe1 Don't overflow trying to draw ticks on ruler (KICAD-9HV). 2025-07-03 16:34:21 -06:00
Jeff Young
6ef9e93cd5 Don't let arc radii blow up (KICAD-BS4). 2025-06-30 11:59:08 -06:00
Jeff Young
e8e7282fe1 Fix a bunch more bugs in bezier approximation. 2025-05-26 18:12:43 +01:00
Jeff Young
e44c5a7fcd Use maxError when converting bezier to polyline.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20312
2025-05-26 13:37:57 +01:00
jean-pierre charras
69891438a6 Coverity warning fixes. 2025-05-18 13:44:04 +02:00
jean-pierre charras
8480b27042 Hatched circle shape: fix incorrect clipping of hatches.
- Fix size of converted polygon in Pcbnew
- Fix approximation of converted polygon in Eeschema: one cannot use ARC_HIGH_DEF
as error in Eeschema because this value is defined for Pcbnew, and not suitable
in Eeschema.
2025-05-17 14:01:02 +02:00
jean-pierre charras
b3c6a03171 Fix a few Coverity warnings (uninitialized vars). No actual code change 2025-05-01 15:39:58 +02:00
Damjan
af11746cc4 pcbnew and eeschema: Table and textbox rotation / text justification fix 2025-04-21 13:32:46 +00:00
Jeff Young
60364a9062 Performance improvements for hatched fills (round 2)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20570
2025-04-08 17:35:35 +01:00
Jeff Young
845cdb1b25 Performance optimisations for hatching. 2025-04-07 21:11:46 +01:00
Jeff Young
0659290417 Simplify hatch damage/rebuild and move it out of view.
There should be far fewer hatched objects than other
objects, so we're spending too much effort finding
all the possible damage when we probably should
just be auto-regenerating all the hatching.

This also moves it out of being done during redraw,
which was proving problematic.  Plus the refill
zones architecture does it during commit, and has
a lot more miles behind it.
2025-04-07 11:46:02 +01:00
Jeff Young
7a9db0f8c1 Formatting. 2025-04-05 22:18:17 +01:00
Wayne Stambaugh
11edaa6e4a Use arc mid point for footprint library parity DRC testing.
The arc center is a pseudo coordinate which is calculated for drawing
purposes.  This mid point is fixed unless the arc is modified which
should result in more reliable arc parity footprint library DRC testing.

Also change EDA_SHAPE::Compare() to use the arc mid point.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15917
2025-04-04 15:30:44 -04:00
Jeff Young
822e188d55 Knockout entire hatched shape when filling zones.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20510
2025-03-31 17:31:35 +01:00
Michael712
d59f624001 Don't use transform coordination for height/width property display of rectangles
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20468
2025-03-28 16:38:12 +00:00
Jeff Young
01c1ff47ad Don't generate hatched fills for connectivity, etc.
(And in particular, don't regenerate them from
within the multi-threaded connectivity algo.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20451
2025-03-26 14:50:34 +00:00
Jeff Young
413d6747c5 Collapse SCH_TABLE border drawing into shared code.
Also pushes GetCornersInSequence() into EDA_SHAPE
so it can be shared between SCH_TABLE and PCB_TABLE.

Also fixes bug in drawing column rulings over the
right external border.

Also fixes a bug with dialog control enabling.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20350
2025-03-16 20:21:49 +00:00
Jeff Young
50174ec528 Beware of infinite recursion on colliding hatched shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20264
2025-03-08 21:23:14 +00:00
Jeff Young
46378dc760 Dirty hatching from SwapShape().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20180
2025-03-03 10:35:05 +00:00
Jeff Young
b1a4b77291 Solid fill mode is FILL_T::FILLED_WITH_COLOR for SCH_SHAPE.
(It can also be FILL_T::FILLED_WITH_BACKGROUND_COLOR
for symbol items, but those have their own getters/
setters.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20168
2025-03-02 16:05:35 +00:00
Jeff Young
7f935e290a Fracture hatched fill polygon.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20125
2025-02-28 18:52:56 +00:00
jean-pierre charras
a414cb0a17 EDA_SHAPE: fix crash when trying to create a hatch pattern inside a circle. 2025-02-27 18:03:24 +01:00
Jeff Young
3f15b0d75b ADDED: hatched fills for shapes. 2025-02-24 11:08:29 +00:00
Jeff Young
6b6729284c Remove default line styles from all items except eeschema wires and buses. 2025-01-20 11:30:46 +00:00
Seth Hillbrand
6d40bf049e Hold fp data constant
We cache arc data to ensure that we know if it has changed since
loading, however footprints perform transformation (displacement +
rotation) on their internal elements, so we need to provide the same
transformation to the cache in order to assure it matches when writing
to disk, otherwise, the arc midpoint will be recalculated leading to
instability

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19648
2025-01-16 16:05:23 -08:00
Wayne Stambaugh
5c8f4697ca Common folder housekeeping part 1. 2025-01-12 12:06:45 -05:00
Alex Shvartzkop
7afa6a086e Show "Selected 2D Length" for tracks and shapes in message panel.
Useful to verify length-matching.

Also show Length for arc shapes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19339
2025-01-06 18:45:28 +05:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Jeff Young
f1cbcc83fe Fixup fill versions.
Older versions saved some non-symbol shapes with wrong fill mode.

The property inspector also sets the wrong fill mode.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19254
2024-12-25 15:14:54 +00:00
jean-pierre charras
776075ee35 Eeschema, fille polygons: fix HitTest inside polygon.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19255
2024-12-06 18:09:17 +01:00
Jon Evans
3129e072c4 API: Move graphics and text handling to common
Required moving API_HANDLER_COMMON out of kicommon
2024-11-28 11:28:06 -05:00
Dhineshkumar S
cb41f39045 Disable custom color selection when Fill Mode is Body Background Color
Currently, the system allows custom color selection for the Fill Color
property in the Properties toolbar even when Fill Mode is set to Body
Background Color via the Properties window. However, this does not update
the color to match the Body Background color. To fix this, custom color
selection for Fill Color will be disabled when Body Background Color is
chosen.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18919
2024-10-28 15:48:02 +00:00
John Beard
215533f31a Unify flip direction handling
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).

Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.

This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
2024-09-27 17:13:13 +01:00
John Beard
7dfac8d1ab Bezier: Correct bounding box calculation
Beziers can extend outside the control point hull,
and can also be far inside the hull. Especially the latter
interferes with selection.

So use the approximated segments to determine.
2024-09-27 06:23:04 +01:00
John Beard
0e788f97ca Bezier: add fill to properties panel 2024-09-25 22:20:58 +01:00
jean-pierre charras
513d659ce8 Fix incorrect flip for graphic segments.
For some obscure reason, the end points of segments were swapped.
Note graphic RECTANGLE shapes have still an issue when flipped, but this
is a very different issue.
2024-08-26 19:37:23 +02:00
Jeff Young
5fba8289aa Formatting. 2024-06-22 23:54:57 +01:00
Seth Hillbrand
bcf6b620a8 Large rework of BEZIER_POLY
Add direct handling of quadratic beziers to save compute time and number
of points.  Update cubic interpolation to reduce number of points
generated for a given smoothness

Cache data on open and used cached data to avoid multiple re-calcs

Remove minimum line length and number of segments and replace with
standard max error level.  Allows us to specify the tolerance of bezier
interpolation
2024-06-18 17:55:41 -07:00
Jeff Young
4a01f322ff Special-case hit-testing of filled schematic rule areas.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17879
2024-06-01 22:48:02 +01:00