Commit Graph

659 Commits

Author SHA1 Message Date
Jeff Young 5875f89531 Centralize text size clamping.
Also introduces alg::clamp to improve readability of
std::max( min, std::max( value, max ) )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14876
2023-06-03 20:29:51 +01:00
Jeff Young 97cf7c874e Handle Altium dimension angles and non-unit suffixes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13751
2023-06-02 18:30:16 +01:00
jean-pierre charras 9a47b34499 Replace PAD_SHAPE::RECT by PAD_SHAPE::RECTANGLE to avoid a collision NAME with a windows header on MSYS2, creating many compil warnings. No actual code change. 2023-06-02 12:18:24 +02:00
Roberto Fernandez Bautista bb90aa24b7 Add basic QA test to CADSTAR PCB footprint import 2023-05-29 23:29:28 +02:00
Roberto Fernandez Bautista 9633c8af22 CADSTAR PCB: Fix regression in loading of thermal pads
Due to removal of SetPos0 in 28028c94, we now don't need to compensate
for the position of the footprint while importing.
2023-05-29 16:41:47 +02:00
Jeff Young 65e53b8ecd Move SHAPE_POLY_SET::Inflate's error spec from a seg-count to a max-deviation.
1) Also reorders parameters to make sure the compiler helps out.

2) This also makes it harder to mess up the discrepency between
   BOX2I/wxRECT/etc::Inflate() and SHAPE_POLY_SET::Inflate.

3) Also fixes a couple of bugs where the corner strategy was passed
   in as a segCount.

4) Also fixes a couple of bugs where the error wasn't forced to the
   outside to match the ERROR_LOCATION.

5) Also fixes a couple of bugs where the seg count was specified
   without regard to an already passed-in max deviation
2023-05-29 15:29:03 +01:00
Roberto Fernandez Bautista dfebe516c5 CADSTAR PCB: Fix memory leak 2023-05-28 23:56:43 +02:00
Jeff Young 768fbf5af2 Give up on trying to calculate text bounding boxes.
It results in too many hacks strewn through the code.  Just draw the
text and measure it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14803
2023-05-26 18:44:33 +01:00
Jeff Young 05fef51d81 Push rendering portion of text cache generation down into CALLBACK_GAL. 2023-05-25 11:25:32 +01:00
Seth Hillbrand 48ecd742eb Maintain file permissions when renaming
Temporary and autosave files do not neccessarily have the correct
permissions set to replace existing project files.  This updates the
permissions to match the existing values where possible

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13574
2023-05-24 17:09:38 -07:00
jean-pierre charras 76d66571e4 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.
Fixes #14804
https://gitlab.com/kicad/code/kicad/-/issues/14804
2023-05-24 18:21:50 +02:00
Jeff Young 502da2d03c Performance improvements. 2023-05-21 11:23:56 +01:00
Alex 9d452a6097 Fix opening boards with deprecated features. 2023-05-20 07:39:01 +03:00
Jeff Young 8b1fd62d35 Make pad & via teardrops 1st-class citizens (props of the pad/via)
Change teardrop generation to rely more heavily on BOARD_CONNECTIVITY
for improved performance.

Add updating of teardrops on BOARD_COMMIT::Push().

Also converts m_CopperItemRTreeCache to std::shared_ptr.
We don't copy it around anyway, and having to create a new set
of std::unique_ptr's for each operation is likely to be more
expensive than std::shared_ptr's overhead.
2023-05-19 18:02:03 +01:00
Ian McInerney 20ec8ed303 Fix GitLab URLs to point to the correct project page
GitLab 16.0 removes support for URLs that don't contain /-/ after the
repository name, so the report bug feature and various links we had in
the source (including the git-fixes script) would lead to a 404 error.

See GitLab docs for deprecation/removal notice:
https://docs.gitlab.com/ee/update/deprecations.html?removal_milestone=16.0#legacy-urls-replaced-or-removed

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14759
2023-05-17 11:23:00 +01:00
Jeff Young b41d446f58 Fix a bunch more issues with sheetpaths and allowExtraText.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.

There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.

Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).
2023-05-05 17:23:52 +01:00
jean-pierre charras 631dde3ed1 Pcbnew: fix crash when loading a file having vias on connected layers only.
It was due to an access out of bounds in a std::array
Fixes #14668
https://gitlab.com/kicad/code/kicad/issues/14668
2023-05-03 16:06:32 +02:00
Jeff Young c31fb435e6 Add missing setting to Dimension Properties dialog.
Also fixes a bug where during file save we were calling
GetPosition() on the PCB_TEXT but getting the DIMENSION's
version.

Fixes https://gitlab.com/kicad/code/kicad/issues/8447
2023-04-30 22:45:19 +01:00
jean-pierre charras 1406341d2d Fix a few doxygen errors (no actual code change) 2023-04-19 16:20:24 +02:00
Marek Roszko ea077bc34d Banish ignore.h to core 2023-04-18 22:44:04 -04:00
jean-pierre charras b2bf3229e6 BOARD::Move(): o not move twice PCB_SHAPES in footprints. Altium importer:
fix incorrect position of imported PCB_TEXTs in footprints.
2023-04-14 10:42:02 +02:00
Marek Roszko 37eaa29679 Fix crash due to extra right parens in pcad files
Fixes sentry KICAD-TA
2023-04-11 21:52:39 -04:00
Marek Roszko ed94bc4bf9 Don't crash on empty pcad polygons
Fixes sentry KICAD-103
2023-04-11 21:38:59 -04:00
Mike Williams 32eb1ef77e Sch->PCB: propagate DNP from symbols to footprints attributes
Also add a 3D viewer toggle.
2023-04-10 13:11:21 -04:00
Jeff Young 13e79af8a0 Eagle template footprints don't actually belong to board.
Set their parent to nullptr before deleting (as the board may have
already been deleted).

Likely fix for Sentry KICAD-79.
2023-04-04 14:18:49 +01:00
Jeff Young 28028c941e Retire Local/Draw coords distinction from PAD (the last object to have it). 2023-04-02 18:02:41 +01:00
Jeff Young b78e0a55b1 Naming conventions. (No functional changes.) 2023-04-02 11:48:23 +01:00
Jeff Young 04cdca837e Remove GUI dialogs from PCB plugin. 2023-04-01 11:37:34 +01:00
Jeff Young bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Roberto Fernandez Bautista d5bc223ff2 CADSTAR PCB Importer: Ignore construction layers on outer surfaces
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14443
2023-03-29 23:46:22 +02:00
Roberto Fernandez Bautista aaeb8ca739 CADSTAR PCB importer: Fix loading of rounded rectangle pads
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14445
2023-03-29 20:53:14 +02:00
Roberto Fernandez Bautista 89441d807d CADSTAR PCB importer: Fix incorrect position of overridden pads 2023-03-29 20:53:14 +02:00
Wayne Stambaugh 28776f5745 Text attributes object improvements.
* Add compare method to COLOR4D object.
* Add unit test to validate COLOR4D comparison method.
* Add missing color test in text attribute comparison method.
* Add unit test for text attribute object.
* Remove unnecessary headers from text attribute header.
* Move text attribute code into separate source file.
2023-03-29 12:53:45 -04:00
Marek Roszko 604a7d69db Move up a layer validity check to prevent crash
Fixes sentry crash KICAD-RF
2023-03-25 17:12:22 -04:00
Marek Roszko eb90448247 Fix typo 2023-03-24 19:54:41 -04:00
Marek Roszko 8a8589b9db Fix cli crash due to dialogs buried in the pcb parser...
Fixes sentry KICAD-Q2
2023-03-24 19:52:48 -04:00
Seth Hillbrand 19d0aceda3 Remove superfluous m_status variable
This used to be used to store information for the item similar to
m_state but it has been deprecated and no uses remained
2023-03-24 09:38:39 -07:00
jean-pierre charras ac71227e75 Fix compil warnings. 2023-03-23 18:36:59 +01:00
Roberto Fernandez Bautista 55a379f61b Fix build: Add missing header include 2023-03-16 22:07:04 +01:00
Roberto Fernandez Bautista 3d661585dd Fix build errors and warnings from CADSTAR 2023-03-16 21:17:40 +01:00
Roberto Fernandez Bautista 5efec4cd51 CADSTAR PCB: Ensure pads have correct position and footprints at 0,0
Fixes a display issue in the footprint preview where all the pads
were displayed at 0,0
2023-03-16 21:07:09 +01:00
Roberto Fernandez Bautista 2cefabc99a CADSTAR PCB: Fix loading of filled circles (load as polygon for now)
todo: need to detect if what we are drawing is a circle.
2023-03-16 21:07:09 +01:00
Roberto Fernandez Bautista 6f5321c481 ADDED: CADSTAR .cpa footprint libraries 2023-03-16 21:07:08 +01:00
Roberto Fernandez Bautista 8f83f27336 CADSTAR SCH: Refactor loading of symbols out of loading part info 2023-03-16 21:07:06 +01:00
Roberto Fernandez Bautista 738b36cf7d CADSTAR csa / cpa ignore Hierarchy
This node doesn't have any equivalent in KiCad so for now we ignore it. In future, we could parse it in detail, to obtain the tree-structure of symbols/footprints in a cadstar library
2023-03-16 21:07:06 +01:00
Jon Evans 10d1ba59d8 Fix compile warning 2023-03-05 18:11:41 -05:00
Jeff Young 461def2719 Move automatic dimension processing inside PCB_DIMENSION_BASE.
Also move dimension precision to an enum so it can get a proper dropdown
in the properties inspector.
2023-03-05 15:19:06 +00:00
Jeff Young 23accffc6d Add Property Inspector support for dimension objects.
Includes changing the class hierarchy so that dimension objects inherit
from PCB_TEXT rather than containing a PCB_TEXT member variable.
2023-03-04 23:16:46 +00:00
Wayne Stambaugh 789bf6455a Coverity fixes and code cleaning. 2023-03-02 09:04:47 -05:00
Johannes Pfister a87550a2c6 When importing legacy PCB dimension: Use automatic dimension when Unit couldn't be determined 2023-02-28 11:59:47 +00:00