Commit Graph

175 Commits

Author SHA1 Message Date
Seth Hillbrand 6c9c75eb07 Remove property.h and property_mgr.h from inspectable.h
This breaks the view_item.h -> inspectable.h -> property.h chain that
pulled wx/propgrid/property.h into 150-200 TUs. The lean inspectable.h
now includes only wx/any.h, wx/string.h, wx/variant.h.

Headers using DECLARE_ENUM_TO_WXANY (board_item.h, sch_item.h) retain
their property.h include since the macro requires it.
2026-02-13 19:54:46 -08:00
Jeff Young 8d067fa3a7 Fix typo in assertion message. 2026-01-30 19:15:57 +00:00
Wayne Stambaugh d68fad564f Coding policy fixes.
Remove all wxLogDebug instances by either replacing them with wxLogTrace
calls where it was obvious what the trace flag should be or out right
remove them from the code base.
2026-01-13 11:27:18 -05:00
Seth Hillbrand 6a8afd5b19 Fix hatched shape display depending on zoom level
The display of hatched shapes (HATCH, REVERSE_HATCH, CROSS_HATCH fill modes)
would flicker and show missing lines at certain zoom levels.

Fix by properly handling the dirty flag and enforcing a minimum line
width in the painters.  Also changed the drawing function to only draw
with lines.  The cross-hatch optimization is maintained for export, 3d
and hit tests

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20562
2026-01-08 11:06:43 -08:00
jean-pierre charras 409b63c222 Fix ROUNDRECT::TransformToPolygon() when the ROUNDRECT is not normalized.
After recent changes, TransformToPolygon() did not work with a not normalized ROUNDRECT.
Also fix a crash with empty polygon or SHAPE_LINE_CHAIN in eda_shape and
convert_shape_list_to_polygon.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22633
2026-01-04 10:33:25 +01:00
Jeff Young 7d47e4031c Formatting and other cleanup. 2025-10-31 13:22:50 +00:00
Mike Williams ccf6e45eb9 poly: just return a buffer
This mimicked a pattern where we would reuse a buffer in high
performance paths, but this shape is never used like that, and just made
all of the calling code more annoying.
2025-10-30 12:43:56 -04:00
Jeff Young 3c4db94469 Fix some holes in arc handling in SHAPE_LINE_CHAINs.
Includes some of the NearestPoints() routines,
some of the Collide() routines, and the lineStyle
stroker.
2025-10-23 17:43:30 +01:00
Jeff Young ce6d6cd5b2 Don't depend on a global MaxError value.
It can't handle multiple IUScales.
2025-10-23 17:43:29 +01:00
Jeff Young cf0adbb1dc Hatched fills get their own color.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22016
2025-10-17 23:04:07 +01:00
Jeff Young aa72a7a257 Handle rotation of rounded corner rectangles.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21634
2025-10-08 15:16:10 +01:00
Jeff Young c12cc19ef4 Rename "Expand Selection" menu item in selection tool.
(We have a different "Expand Selection" command now,
and this was never a great name for showing
more choices anyway.)

Also treat tablecells as opaque when guessing
selection candidates.  It's unlikely there's anything
under them and keeping to their text bounds feels
counter-intuitive.
2025-10-06 21:16:36 +01:00
Jeff Young 2fe7219474 Support translation in tool context menus that are long-lived.
(The specialized ones are OK as they're created
for each use.)

Also, enum maps must be untranslated.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21859
2025-10-01 00:03:45 +01:00
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