7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 10:39:19 +00:00
Commit Graph

118 Commits

Author SHA1 Message Date
Ian McInerney
1825ab689f Remove duplicate data tag in drawing sheet format
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19931
2025-02-11 19:58:46 +00:00
John Beard
636c6c4efb Eeschema/pcbnew: fix pasted image saving
The m_imageData buffer in the BITMAP_BASE is an
internal implementation - the public API to persist the
data to a stream appears to be SaveImageData - so use that,
which hides the implementation (and generates the image data
"live" when needed).

Remove the public access to the m_imageData buffer as it isn't
needed for public use, and also is misleading.

Also break out the formatting of the data into KICAD_FORMAT,
as it's currently replicated in eeschema/pcb/pagelayout
formatting code.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19772
2025-01-31 23:01:07 +08:00
Jeff Young
89706aedae Resolve some variables from the project. 2025-01-16 15:59:51 +00:00
Wayne Stambaugh
5c8f4697ca Common folder housekeeping part 1. 2025-01-12 12:06:45 -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
4883c27972 Handle ERC/DRC assertions in drawing sheet.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19132
2024-12-02 20:13:43 +00:00
Jeff Young
6686ade45b Remove (somewhat atrophied) manual pretty printing.
Also fixes a bug where the pretty printer didn't insert
linebreaks for a forest (it assumed a single tree root).

Also further regularises bool and quote formatting.
2024-11-28 11:08:16 +00:00
Seth Hillbrand
9dfcb6a362 Cleanup ViewGetLayers()
Old style c-array replaced with vector returns
2024-11-21 13:18:36 -08:00
Jeff Young
b549c4feec Drawing sheet can't share glyph cache entries with editors.
(They use different internal units.)

Also fixes a fialure of CAIRO_GAL to reset the fill
and stroke after drawing outline glyphs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18579
2024-08-22 12:23:21 -06:00
Seth Hillbrand
69849ba3ca Replace custom Clamp with std::clamp
Fixes bug in parser that had the elements in the wrong order due to our
custom version not matching the standard order
2024-07-25 19:17:17 +02:00
Seth Hillbrand
77797103f7 Add ability to embed files in various elements
Schematics, symbols, boards and footprints all get the ability to store
files inside their file structures.  File lookups now have a
kicad-embed:// URI to allow various parts of KiCad to refer to files
stored in this manner.

kicad-embed://datasheet.pdf references the file named "datasheet.pdf"
embedded in the document.  Embeds are allowed in schematics, boards,
symbols and footprints.  Currently supported embeddings are Datasheets,
3D Models and drawingsheets

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6918

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2376

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17827
2024-07-15 16:06:55 -07:00
Jeff Young
16340e6cf4 Support both short and long item descriptions. 2024-06-28 22:10:22 +01:00
Jeff Young
080cbbe0dd Error reporting for drawing sheet loading. 2024-06-24 20:22:29 +01:00
Jeff Young
92c8ddfddb Prefer infobar to logged warnings/messages.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18242
2024-06-24 16:26:40 +01:00
Seth Hillbrand
a9ae86eefd Cleanup geometry functions
Added Distance(VECTOR2) function that returns a double.  Removed
superfluous EuclideanNorm, GetLineLength, integer constructor for
EDA_ANGLE (this promotes to double in the CTOR), DistanceLinePoint and
HitTestPoints

Also extended the size for arc calculations that get distances to center
points to avoid overflow
2024-05-31 12:26:37 -07:00
Jeff Young
c998234dec Restore accidentally deleted text size constraint algo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17284
2024-05-03 22:12:34 +01:00
Jeff Young
65554943e0 lint reduction 2024-05-03 22:12:34 +01:00
Alex Shvartzkop
865e3a9f3c Improvements when working closer to 32-bit integer limits.
- Changes BOX2 size to extended coordinates.
- Adds BOX2ISafe to construct a BOX2I that will fit in int32.
- Adds more checks.
- Safer computations.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17670
2024-04-23 16:34:07 +00:00
Alex Shvartzkop
e71cbea7f8 Use a version string without the extra packaging info in drawing sheets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17176


(cherry picked from commit c59fac4089)
2024-02-29 01:24:39 +00:00
Jeff Young
e7abeb3c38 Cleanup. 2024-02-24 20:05:51 +00:00
Jeff Young
33d93b79a3 Handle nested text variable references in title block.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16919
2024-02-09 12:37:13 +00:00
Alex
d4879e05ac Use semantic version in drawing sheets. 2024-02-03 20:24:26 +03:00
Marek Roszko
22288adb7d Reduce KICAD_VERSION in drawing sheets to something simple 2024-01-28 15:48:02 -05:00
Alex Shvartzkop
26c8c718eb Fix drawing sheet border random thickness glitch. 2023-12-05 19:31:26 +03:00
Jon Evans
f3360a4442 Quote base64 data in DS and schematic 2023-11-29 16:17:41 +00:00
Jon Evans
4ff127b452 Parse generator_version and improve error output on mismatch
Also bump symbol format version for generator_version
2023-11-29 16:17:41 +00:00
Jon Evans
0face5a891 Add prettification to pl_editor; bump version 2023-11-29 16:17:41 +00:00
Marek Roszko
d1ecf3790c Add generator version 2023-11-29 16:17:41 +00:00
Mike Williams
f993e45325 Variables: make consistent across editors
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16180
2023-11-29 09:55:17 -05:00
Jeff Young
3c1478367f Handle flipped state when checkging item against viewport.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15768
2023-09-30 22:54:45 +01:00
Jeff Young
d6a862cafe It's "internal units", not "user interface". 2023-09-30 22:54:45 +01:00
Marek Roszko
22b733209d Fail GAL on its header leaking audit
Maybe we should rethink directly accessing GAL so much, but at least 600 files didn't need GAL leaked into them due to view_overlay.h
2023-09-18 19:52:27 -04:00
Marek Roszko
11de95778b Unwrap the FROM_UTF8 macro in favor of direct function
The extern just gets annoying to try to export the func later. We also yeet TO_UTF8 to string_utils.h for parity.
2023-09-09 00:10:57 -04:00
Seth Hillbrand
f9b745f3d2 Allow multiple format image saving
- Keep original image data.  When loading JPEG, this avoid recompression
  that changes file data and decreases image quality
- Allow schematic and page layout editors to store non-PNG data as well
- Move page layout editor to store base64 instead of hex-coded data
2023-09-06 12:12:32 -07:00
Jeff Young
5e112ca78e ADDED: parameterize font metrics and allow customization of overbar height. 2023-08-06 20:57:41 +01:00
jean-pierre charras
4f3e7e6821 *.wks files: always save text font when it is not the default font.
Fixes 
https://gitlab.com/kicad/code/kicad/-/issues/15154
2023-07-09 10:51:33 +02:00
Alex Shvartzkop
b242779f3b Put background color behind transparent bitmaps in eeschema printing.
Most virtual printers don't support alpha blending via AlphaBlend (MSW)
properly, nor masks.
2023-07-03 02:15:05 +03:00
jean-pierre charras
e7fac08c2f Worksheet editor: fix crash when adding new graphical text object.
Was due to use of a null pointer.
Fixes 
https://gitlab.com/kicad/code/kicad/-/issues/14966
2023-06-16 17:31:38 +02:00
Jeff Young
782c73300b Move drawing sheet datastructures to EDA_IU_SCALE.
Or mostly, at least.  Plotters still define their own mils-to-iu scale.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14934
2023-06-12 22:34:25 +01:00
Jeff Young
3ab9175553 Spread the error-bar move evenly around justified text. 2023-05-27 18:53:04 +01:00
Jeff Young
f35a88ce0b Cache LIB_PIN text extents for performance.
Also fixes a bug where we didn't triangulate at all when the char
count didn't warrant the likely overhead of spinning up a
thread_pool.

And fix another bug where EDA_TEXT::GetRenderCache() wasn't using
the given font.

Also reverts using the cache for drawing-sheet text.  The text
items are created from scratch from the data items each time
they're drawn, so there's never an existing cache to make use of.
Instead, we now check that the item is in the view, using a very
approximate bounding box generator (because even generating a
real bounding box shows up large in profiles).

And, lastly, fixes a bug where EndPos was never considered in
DS_DATA_ITEM::IsInsidePage().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14822
2023-05-27 16:32:11 +01:00
Jeff Young
4ed267394a Outline font performance improvements.
1) Don't fracture font glyphs when generating them; we're going
   to fracture during triangulation anyway.
2) Don't check for self-intersection when deciding to fracture.
   It costs nearly as much as the fracture does.
3) Cache drawing sheet text.
4) Use the current font when checking for cache validity.
5) Parallelize glyph triangulation.
6) Don't invalidate bounding box caches when offset by {0,0}
7) Use the glyph cache when generating text effective shape.
8) Short-circuit NormalizeJustification() if its center/center.
9) Don't triangulate for GuessSelectionCandidates()
10) Avoid sqrt whenever possible.
11) Pre-allocate bezier and SHAPE_LINE_CHAIN buffers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14303
2023-05-27 01:35:40 +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
Jeff Young
0fb1ccff21 Commenting and formatting. No functional changes. 2023-03-13 18:29:55 +00:00
Marek Roszko
aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
jean-pierre charras
5da5ccc4bf pagelayout_editor: fix some minor issues:
- text color not always stored in file
- Indicator for changes in main title not updated after save.
2023-02-09 14:16:26 +01:00
jean-pierre charras
0d903d43a0 pagelayout editor: Add tests for invalid parameters.
Invalid parameters are repeat count < 1, size < 0 and default size < 0.01 mm
2023-02-07 12:53:34 +01:00
Seth Hillbrand
823607796b Additional safety around wks bitmaps
Invalid files can create large problems for unloaded PNG data

Fixes https://gitlab.com/kicad/code/kicad/issues/13801
2023-02-07 12:08:39 +01:00
Marek Roszko
0ff32d20cd wxS more things 2023-01-22 09:41:42 -05:00
Marek Roszko
323bec4adc Remove hidden undocumented env var for worksheet
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8342
2023-01-22 08:56:28 -05:00