Commit Graph

64 Commits

Author SHA1 Message Date
Jeff Young bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
jean-pierre charras 10d4c63c31 EDA_SHAPE_DESC(): catch a std::runtime_error when emitted by
template<typename T> T Get( PROPERTY_BASE* aProperty ) to avoid a crash,
and displays in Debug mode the runtime error message.
Fixes #14347
https://gitlab.com/kicad/code/kicad/issues/14347
2023-03-20 16:07:08 +01:00
Jon Evans 1651b44ab1 Fix some PCB_SHAPE properties
Hide irrelevant position/start/end properties
for shape classes that don't use them.
2023-02-23 20:23:44 -05:00
Marek Roszko ac94995f70 Some more wxS 2023-01-16 19:07:50 -05:00
Jon Evans 826f641dff Properties: Add shape fill control 2022-12-22 17:45:16 -05:00
jean-pierre charras 75f1067642 GRAPHICS_CLEANER: fix bad detection of short Bezier curves that can be cleaned
eda_shape: small enhancement: when generating a polyline from the Bezier curve,
filter the last point if the last segment is shorter than the given min lenght
2022-12-10 18:19:09 +01:00
Jeff Young ec9c6a8053 Separate creation of polygons for open and closed shapes.
This allows us to create a bounding hull from an open shape-line-chain,
which is useful for defining milled slots.
2022-11-27 18:29:41 +00:00
Jon Evans 396db7794d Properties: add friendly names to shapes 2022-11-25 12:37:47 -05:00
Seth Hillbrand 056f45cd70 Fixup most intersecting polygon points
Remaining is the intersecting complex pad, so this keeps the error
message when drawing

Fixes https://gitlab.com/kicad/code/kicad/issues/12806
2022-11-08 16:05:04 -08:00
Jon Evans a5d685ff5c Handle coordinate transforms in properties system
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12320
2022-10-31 23:01:52 -04:00
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
jean-pierre charras 0a620816a8 Eeschema: edit arc: keep arc angle <= 180 degrees when moving a arc end. 2022-10-06 09:22:59 +02:00
jean-pierre charras 92f70a9fa2 Eeschema: ensure arcs are < 180 deg when creating them. 2022-10-05 11:33:12 +02:00
Jeff Young 64a6fc0fd4 Push UNITS_PROVIDER down into a low-level mixin.
This allows us to also construct cheap UNIT_PROVIDERs for specific
tasks when necessary.
2022-09-19 17:10:59 +01:00
Jeff Young 45d6b4a9fc Readability improvements. 2022-09-19 11:18:20 +01:00
Mark Roszko b00178adb3 Nuke base_units from orbit 2022-09-16 04:38:10 +00:00
Jeff Young c48286b879 Fix missing variable initialization. 2022-09-15 00:45:29 +01:00
Jeff Young 281b9d405a ADDED ability to specify where pad number (& net name) go on custom shaped pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/6627
2022-09-14 11:37:20 +01:00
Jeff Young f17a865593 Move EDA_ITEM hitTest to BOX2I. 2022-08-31 17:18:45 +01:00
Jeff Young 5679b9dbdc Remove a few EDA_RECT instances. 2022-08-31 01:22:49 +01:00
Roberto Fernandez Bautista 029cc65b34 EDA_SHAPE: Remove m_upsideDownCoords hack (Fixes hitTest routine) 2022-08-27 12:51:32 +01:00
Maciej Suminski af71d42307 Renamed PROPERTY_TYPE enum names to avoid a conflict on MSYS2 2022-08-22 21:32:32 -04:00
Maciej Suminski 7f00efe6cf Properties: Fixed conditional properties using enum values in the conditions
When wxAny holds an enum, it cannot be compared with an integer due to a
missing conversion function. In such case, conditional properties
compare a raw value rather than wxAny.
2022-08-22 21:32:32 -04:00
Maciej Suminski 95fd58b25a Properties meta-data for pcbnew classes 2022-08-22 21:32:00 -04:00
Alex 371f6d917f Use VECTOR2I::extended_type instead of long, and int for numeric limits. 2022-08-16 12:08:55 +00:00
Alex 6d739ca9da Improve handling of long distances 2022-08-16 12:08:55 +00:00
Jeff Young 509d233d97 Fix knockout text bounding boxes and hit testing.
Fixes https://gitlab.com/kicad/code/kicad/issues/12133
2022-08-06 00:00:04 +01:00
Jeff Young b727bfc16d Performance: avoid sqrt at all costs. 2022-07-16 18:42:32 +01:00
Jeff Young d0547cbde7 Don't allow 0 line-width for unfilled shapes.
Fixes https://gitlab.com/kicad/code/kicad/issues/12010
2022-07-16 16:26:05 +01:00
Jeff Young 0953395c87 LIB_SHAPE slightly abuses SHAPE_POLY_SET by using it for line chains.
Fixes https://gitlab.com/kicad/code/kicad/issues/11956
2022-07-08 21:35:40 -06:00
Jeff Young 007906cd16 Fix a degeneracy bug in arc collisions.
This also fixes a failure to use the correct effective width for
shapes (which might, for instance, inherit their widths from schematic
defaults, netclasses, etc.).

Fixes https://gitlab.com/kicad/code/kicad/issues/11358
2022-04-08 16:15:58 +01:00
Jeff Young 9402b2aeda Take fill into account when hit-testing arcs.
Fixes https://gitlab.com/kicad/code/kicad/issues/11305
2022-04-01 22:40:29 +01:00
Jeff Young 4f62960334 Update message panel from PCB point editor and SCH drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/11186
2022-03-21 10:32:36 +00:00
Seth Hillbrand cd7141fd10 Cache read arc data for stability
Arcs can be altered by the process of changing from on-disk
representation to in-memory representation.  Saving back to disk without
modifying the arc should not modify the calculated values.

This stores a copy of the on-disk representation that is only used to
save back to disk in the event that the arc is not modified during
editing.

Fixes https://gitlab.com/kicad/code/kicad/issues/10442
2022-03-04 15:20:31 -08:00
Jeff Young d299ddbc7e Cleanup. 2022-02-27 12:05:39 +00:00
jean-pierre charras ff277a36af EDA_SHAPE::MakeEffectiveShapes(): protect against empty polygons.
Fixes #10713
https://gitlab.com/kicad/code/kicad/issues/10713
2022-02-02 20:40:54 +01:00
Jeff Young 5739505aa3 TextBoxes for PCBNew. 2022-01-31 20:00:47 +00:00
Jeff Young 4eac8d7c66 Remove unit-less angles from geometry lib APIs. 2022-01-20 21:10:04 +00:00
Jeff Young 3ba89f50ef Maybe, just maybe, fix LibEdit arc parsing.
Fixes https://gitlab.com/kicad/code/kicad/issues/10455
2022-01-19 22:22:18 +00:00
Jeff Young 8445783216 Fix backwards arcs in legacy LIB_ARCs.
Fixes https://gitlab.com/kicad/code/kicad/issues/10455
2022-01-18 14:08:47 +00:00
Jeff Young 5cc3368b14 Fix bounding boxes and hittesting for arcs in eeschema. 2022-01-16 23:54:59 +00:00
Jeff Young e61144d45a Finish with EDA_ANGLE. 2022-01-16 21:15:40 +00:00
Jeff Young e84c574830 Some more EDA_ANGLE cleanup. 2022-01-16 19:16:18 +00:00
Jeff Young 9b661aea10 EDA_ANGLE for plotters.
Also fixes a compile error in the PNS Playground.
2022-01-16 01:19:45 +00:00
Jeff Young 07013d00e1 More EDA_ANGLE. 2022-01-14 16:08:19 +00:00
jean-pierre charras 431560a46b EDA_SHAPE::SwapShape() : add missing items to the swap list.
Some items (color, fill) were missing in list, so the undo/redo was incorrect
2022-01-14 09:40:15 +01:00
Seth Hillbrand d5faac7614 Better fix for missing end segment
Rather than skipping our endEdit() call in libedit, we need to
parameterize whether we want the shape open/closed.  Closed will remove
the last segment if it lands on the first point.  We don't want that
but we do want to remove the last point if it duplicates the second to
last (in the case of double-clicking)

Fixes https://gitlab.com/kicad/code/kicad/issues/10334

(cherry picked from commit 55020c2b89)
2022-01-10 13:39:39 -08:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Marek Roszko 347e03363a Convert wxPoint/wxSize starting from EDA_RECT usages 2022-01-01 11:30:33 -05:00
Jeff Young f1410f0240 Line styles for PCBNew shapes.
Fixes https://gitlab.com/kicad/code/kicad/issues/2150
2021-12-24 12:36:59 +00:00