Compare commits

...

826 Commits

Author SHA1 Message Date
Wayne Stambaugh ad43570ec0 Tag stable version 8.0.7. 2024-12-02 16:04:30 -05:00
Seth Hillbrand 5dd4718db0 Update translations 2024-12-01 17:25:35 -08:00
dsa-t ea70d8cf4c Translated using Weblate (Russian)
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-12-02 02:25:06 +01:00
ZbeeGin cd2879880a Translated using Weblate (Polish)
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-12-02 02:25:06 +01:00
Pferd O b51c8c1b3d Translated using Weblate (German)
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-12-02 02:25:06 +01:00
Wellington Terumi Uemura 5db1ee930f Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-12-02 02:25:06 +01:00
2tama3 695dd57477 Translated using Weblate (Japanese)
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-12-02 02:25:06 +01:00
Ettore Atalan 224c989072 Translated using Weblate (German)
Currently translated at 99.9% (9192 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-12-02 02:25:05 +01:00
John Beard 80db7ff8cf Pcbnew: update DRC exclusions from DRC dialog
When excluding/re-including DRC violations, update the
BDS list immediately rather than waiting for the
BOARD::RecordDRCExclusions() to be called.

This was implemented in 8.99 in 0598ca0f90
(along with DRC exclusion comments).

Follow that commit's updates of the m_DrcExclusions
structures in an analogous way.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19113
2024-11-29 03:04:43 +08:00
jean-pierre charras 6e6d3e9b03 Revert "Try to fix a link issue in Gerbview" and try another fix 2024-11-25 16:55:28 +01:00
jean-pierre charras c08dd172d6 Try to fix a link issue in Gerbview 2024-11-25 16:38:55 +01:00
Wayne Stambaugh 7972805d07 Tag stable version 8.0.7 release candidate 1. 2024-11-24 19:06:04 -05:00
Alex Shvartzkop a86147b4b1 Optimize ConvertImageToLibShapes for EasyEDA/LCEDA schematic import.
Don't sort all symbol draw items after adding each draw item.

-75% CPU usage on typical schematic imports.

(cherry picked from commit 5323c8587a)
2024-11-24 20:54:24 +03:00
Dhineshkumar S 335bb8792f Fix switching bold option on and off alters text thickness
Currently, unselecting the bold option resets the thickness to the
standard size instead of reverting to the original thickness.
To address this, the original thickness should be preserved so it
can be restored when bold is turned off.

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

(cherry picked from commit 43b1bc52db)
2024-11-24 07:46:40 -05:00
jean-pierre charras c8f7887cf8 Simulator: fix crash when deselecting the Probe Tool in some cases.
If a schematic item was selected, when activating the probe tool from the
simulator, and deactivating from the Select Item sch editor tool, a crash
happened.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18547
2024-11-24 10:34:22 +01:00
John Beard 2fe5c28787 Fabmaster: catch illegal parses up front
Parsing an empty string as double/int produces uninitialised data.
That is likely to cause an undefined amout of chaos later on,
so catch it explicitly with a wxCHECK.

It's still something that shouldn't happen, and could still cause
chaos, but it's at least deterministic. It also avoids putting
gigantic numbers into things that don't expect them. For example
normalising an angle of 1e303 is functionally an infinite loop.

This happens at least in files with missing fields in rows,
like in #19174's file, line 4:

S!U2306!IC!!!!!!SOT_23_5!!!!!SGM2576/TT9107!!!

The file is still broken, but now it loads.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/19174
(cherry picked from commit 4d2d70ce22)
2024-11-24 14:04:57 +08:00
John Beard 64365de9de Update font when needed on italic/bold change
When the italic or bold nature is changed, text using outline fonts may
need to change its font. Add this to the SetItalic/SetBold functions.

Also add a counterpart SetItalicFlag function (following SetBoldFlag)
when you only need to set the flag (e.g. when importing or changing
everything in the text properties dialog).

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18592
(cherry picked from commit b043f334de)
2024-11-24 09:51:54 +08:00
Alex Shvartzkop a950d55cb2 Show empty field for unconstrained length in length tuning properties.
Because it's confusing when the dialog shows last target value, but it
doesn't apply when you start tuning.

Also the last values are remembered in DRAWING_TOOL::PlaceTuningPattern
now, instead of global variables.

Related: https://gitlab.com/kicad/code/kicad/-/issues/18979
2024-11-23 18:11:25 +03:00
Alex Shvartzkop 3748a10ed5 Length tuning workflow improvements:
-Allow changing length tuning settings before tuning has been started
-Do not exit out of the length tuning tool after each placement
-Keep specified settings between pattern placements

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

(cherry picked from commit 78b2e53777)
2024-11-23 17:27:27 +03:00
Alex Shvartzkop 227bb76909 Don't modify m_selection while iterating over it in PCB editor.
This caused a fatal assert when selecting connected tracks with tuning patterns.

(cherry picked from commit fee8560079)
2024-11-23 17:27:16 +03:00
jean-pierre charras a20a6bb2a3 French translation update 2024-11-23 10:16:03 +01:00
jean-pierre charras 7c17aa5974 EEschema: fix crash when repeat an item (ins key), due to a null parent
A recent change set the parent member of a item put in the repeat list to
nullptr (this is OK) but the code to copy an item from this list did not
update this parent member.
From master branch, commit 8f348820
2024-11-23 10:07:38 +01:00
Dhineshkumar S 59795c81c5 Fix copy-paste issue for grids with checkboxes
Handle boolean value parsing during paste operation. The boolean value
was not being handled correctly in grid_tricks, which prevented the
boolean value from being pasted into the target row

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

(cherry picked from commit 07f96b83b7)
2024-11-21 11:37:47 -08:00
Mike Williams 84d00a7887 cli: accept multiple gerber layers for single layer plotting
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19089
(cherry picked from commit 325d6ff064)
2024-11-21 12:55:13 -05:00
John Beard 3774e31db8 Pcbnew: convert to lines should take the width of polygons if it can
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18713
(cherry picked from commit 81c1cd9af1)
2024-11-21 12:32:56 -05:00
Seth Hillbrand 69ac570658 Update translations 2024-11-21 09:29:00 -08:00
Pablo Bianchi 46ecb22ef5 Translated using Weblate (Spanish)
Currently translated at 98.5% (9055 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es/
2024-11-21 18:27:21 +01:00
Jan Straka ff7ea6eae0 Translated using Weblate (Czech)
Currently translated at 84.1% (7735 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-11-21 18:27:21 +01:00
Marco Ciampa 2f70ac171f Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
Marco Ciampa 360011e563 Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
CloverGit 2a0785d188 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-11-21 18:27:20 +01:00
Toni Laiho a480b1a5ba Translated using Weblate (Finnish)
Currently translated at 99.7% (9172 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-11-21 18:27:20 +01:00
Marco Ciampa 6f31e306a1 Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
Pferd O 5983815415 Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-21 18:27:20 +01:00
Marco Ciampa 288050b6ec Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
co8 j 6d36363403 Translated using Weblate (Japanese)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-11-21 18:27:20 +01:00
Marco Ciampa 720c7d9fc4 Translated using Weblate (Italian)
Currently translated at 99.5% (9152 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
Wellington Terumi Uemura e009afd4a1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-11-21 18:27:20 +01:00
ZbeeGin 9e13ff25d0 Translated using Weblate (Polish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-11-21 18:27:20 +01:00
Pferd O af1899ddc3 Translated using Weblate (German)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-21 18:27:20 +01:00
Ian McInerney beb30dd881 Use appropriate tunning pattern icon in menus for tunning pattern generators
(cherry picked from commit 2190c37cd6)
2024-11-21 12:22:38 -05:00
Alex Shvartzkop 6d09293b11 DXF import: scale text size too inside scaled blocks.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18525

(cherry picked from commit 37fb792411)
2024-11-21 12:19:31 -05:00
Alex Shvartzkop ca7378924c Make color picker dialog usable on hidpi monitors.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17860

(cherry picked from commit 894bf45480)
2024-11-21 11:55:54 -05:00
Ian McInerney 74316a62d3 Always use black text in PCB calculator E-series table
The white text in dark mode is too washed out on the cell colors to be
visible. Since we already purposely subdue the colors in dark mode, the
easiest fix is to just always use black text.

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

(cherry picked from commit c7d280dfa1)
2024-11-21 11:34:06 -05:00
Dhineshkumar S 3150f467bb Fix Courtyard layers disappeared
Currently, the used layers passed from parseLayers() do not include
mandatory layers if they are missing in the loaded board file.
To fix this, we can manually add the mandatory layers to ensure they
are always enabled.

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

(cherry picked from commit 6e2ed5666d)
2024-11-21 11:28:37 -05:00
Dhineshkumar S c033c364d4 Fixing Paste Issue in Library Table
Previously, when attempting to paste an entire row copied from the global
table into a project table, the value would be pasted from the cell where
the cursor was focused, rather than from the first cell. This issue
occurred because the first cell, a checkbox column, was not selectable.
To resolve this, the checkbox column should be enabled for selection
when the Left Mouse Button event is triggered

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

(cherry picked from commit 1fc8e65f7a)
2024-11-21 11:15:17 -05:00
Mike Williams 37c14a65ed net navigator: add sheet changes to navigation history
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18616
(cherry picked from commit 284c52845d)
2024-11-21 11:07:22 -05:00
Mathieu Pilato dbf64ac0cf Fix missing current scale in AC simulation
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18313

(cherry picked from commit 10d23ada48)
2024-11-21 09:40:12 -05:00
jean-pierre charras 0eda576189 Gerbview: fix a link issue on msys2: round 2
Reverts commit 6ee9fb4027
Make fix only for mingw/msys2
2024-11-20 18:29:32 +01:00
jean-pierre charras 6ee9fb4027 Gerbview: fix a link issue on msys2
mingw/msys2 is picky about order of files to link.
2024-11-20 18:06:21 +01:00
Kamil Galik 64134cee92 ADDED: 3D Mouse support in places
Gerber Viewer, Drawing Sheet Editor and Footprint Properties 3D Model tab

Fixed https://gitlab.com/kicad/code/kicad/-/issues/14002
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13306
2024-11-20 15:56:19 +00:00
Jeff Young fead0eb33b Manual cherry-pick of ee8d86390e. 2024-11-18 22:44:41 +00:00
jean-pierre charras ff71b324a1 EEschema: fix an issue in sheet cross-references of global labels.
Commit 5ca34147 (a cherry pick from master branch) broke these cross-references.
If was fixed later in master branch, but these changes cannot be cherry picked.
So the old code is reused in 2 functions to fix the issue.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18534
2024-11-17 13:11:23 +01:00
Seth Hillbrand b10ab478bd Fix 3D viewer omission of STEP models with relative path assignment
The project was not assigned to the board in the 3D viewer frame,
resulting in a failure to locate the relative path for STEP models.
To fix this, the current project should be assigned to the board in
the 3D viewer frame.

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


(cherry picked from commit d2e51fdb5f)

c824484c Fix 3D viewer omission of STEP models with relative path assignment

Co-authored-by: Dhineshkumar S <dhineshkumar@cgvakindia.com>
2024-11-17 07:21:14 +00:00
Wayne Stambaugh 710b6adb8c Warn user when template field names contain trailing/leading white space.
When loading a schematic that contains fields with trailing/leading white
space, show an infobar message.  When editing the template field names,
prompt the user to keep or remove any trailing or leading white space
characters from field names.

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

(cherry picked from commit d9d984d2c8)
2024-11-16 20:51:03 -06:00
Mark Roszko 6a01bdbabd Drop the first point of an arc when building an outline when there's a previous point that's being changed
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18125


(cherry picked from commit 8b4253cda4)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-11-16 08:53:01 +00:00
Jeff Young 76e19c6dcf Import PCB into existing project.
Or, to be more direct: don't pull the project rug
out from under EESchema when importing in non-
stand-alone mode.

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

(cherry picked from commit a2f7edde2e)
2024-11-16 02:43:13 -06:00
Seth Hillbrand 8af289c33e Fix error in PointInside
If we are checking a point that is inline with multiple segments, we
were counting both the entry and exit as crossings, leading to points
inside a polygon being registered as outside.  Changing the conditional
to only catch one crossing as required.

Adds a QA check to ensure that this remains fixed

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

(cherry picked from commit 7916b1ddb8)
2024-11-16 02:38:49 -06:00
JamesJCode 35fa7db5c7 Don't reset sheet / screen file names if cancelling repeat insert
in recursive state

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

(cherry picked from commit c05dd18613)
2024-11-16 02:36:23 -06:00
Seth Hillbrand 67739ee3d1 Convert courtyards with error allowance
We convert arcs/circles to polygons with an allowable error.  This means
that the segments might end up being closer than we expect and we should
allow for this deviation when checking courtyards

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

(cherry picked from commit 3a8a5bb378)
2024-11-16 02:34:53 -06:00
Seth Hillbrand d8ba7284a8 Correct pad connections for 45° circular
When calculating the pad bbox, we need to only account for deflation of
zone min width.  Additionally, when calculating spokes for roughly
circular elements, we don't need to go to the bbox corners, so special
case it to rotate after the fact

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18329
2024-11-16 02:34:25 -06:00
Seth Hillbrand fdc0309592 Simplify spoke generation
Sin/Cos are pre-caclulated for all multiples of 45° so we don't need to
short circuit them here.  Calculating the bbox intersection point allows
us to pick spoke sizes that are not overly large so as to miss the hit
point testing in the associated fill areas.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18329
2024-11-16 02:34:25 -06:00
Mike Williams 55d77f0dbb pcb: fix crash on routing many traces
Further improvements could be made to the behavior of the autoroute
functionality in this case, but not crashing is a good start.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18328
(cherry picked from commit 04ff715945)
2024-11-16 02:32:33 -06:00
Seth Hillbrand 14fafebbc7 Handled unconnected nets
These nets may have only a single element in them (no connections), so
be sure to leave the node even without Features

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

(cherry picked from commit 14ccadd2a9)
2024-11-16 02:31:06 -06:00
Seth Hillbrand 7ca472deb8 Handle error when we don't have Eagle Board
This can also occur in libraries, so ensure we're not dereferencing a
null board pointer

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

(cherry picked from commit 89b9b13e21)
2024-11-16 02:30:36 -06:00
Seth Hillbrand fdb3612565 Some fixes for DXF import
In order to find elements, we need to have bbox correctly set.  ::min()
for doubles, just gives the smallest positive value.  So negative placed
graphics don't trigger the right bbox and they get nopped out of
existence.

Similarly, following the advice from @msteinbeck, we elevate the degree
of the spline before converting it to beziers in order to properly
represent in KiCad

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

(cherry picked from commit e0fc7b2b88)
2024-11-16 02:30:03 -06:00
Seth Hillbrand bf59a6305a Handle DXF files with out of bounds values
First, ensure that we calculate the bbox of the imported elements.

If the total BBOX is outside our allowed value, refused to import.  This
needs to be scaled or addressed in an external editor

If the bbox fits, then make sure that we clamp it such that the largest
element is still within our bounds

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

(cherry picked from commit a724b3d8b1)
2024-11-16 02:29:19 -06:00
Dhineshkumar S 17db770d92 Fix copy and paste issue in bus alias definition
Previously, creating a new member row by pasting text from the clipboard
did not trigger a cell value change which prevented the correct
association of the member value with the alias. To ensure this, we force
the member to be updated with the current alias before closing the dialog,
as well as with the previous alias when adding a new one

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

(cherry picked from commit cd40c6bbbf)
2024-11-16 02:27:26 -06:00
Dhineshkumar S b3004c9d96 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

(cherry picked from commit cb41f39045)
2024-11-16 02:09:46 -06:00
Dhinesh c54ebdecd2 Fix missing text and graphics in PDFs generated by "Plot to PDF"
The "Plot to PDF" function was producing PDF files that lacked text and
graphic items in viewers like Adobe and Foxit. This issue was caused by
the use of the %g format specifier for floating-point numbers defined in
the PDF specification when writing text and drawing shapes in the PDF.
This incorrect format led to a "Too Few Operands" error during rendering.
To resolve this issue, all floating-point numbers must be specified in
fixed-point format according to the PDF specification wherever the issue
was generated.

Fixes #16465

(cherry picked from commit 8851cd77ab)
2024-11-16 02:08:50 -06:00
Ian McInerney 6fc15ed8df Make instance checker path globally writable
On Linux, this directory is shared between users, so a multi-user
machine needs to let the other users have access to the directory to
create their own lockfiles.

(cherry picked from commit 921358b096)
2024-11-16 01:43:18 -06:00
John Beard e7779d9b91 Exclude letter hotkeys from Shift fallback
From master branch

There is a fallback mechanism here designed to catch cases
where a hotkey is bound to a key that needs Shift to be
input (e.g. ? requires Shift on many non-US keyboards,
but the hotkey for that should be '?', not 'Shift+/'). For any key
where the two options are equally-valid "main" key (e.g. '6' and '^'
or '?' and '/' or ':' amd ';'), this is correct, as it allows
the hotkey to be simply the character in question.

Letters don't require this treatment - using this fallback
in the letter case means that a hotkey bound to 'B' will
also fire when 'Shift+B' is pressed, even when Shift+B is
bound to something else. In fact, it could even preempt the
real Shift+B hotkey.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19093
2024-11-13 19:50:48 +01:00
jean-pierre charras 06a91637a7 3D viewer: Ensure the 3D display view is not modified after left clicking.
After opening a context menu and left clicking on the 3D canvas, the view
was modified because a drag event was generated, probably a wxWidgets bug.
From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17422
2024-11-11 17:11:07 +01:00
Alex Shvartzkop 08e9ce2828 Fix an "unreferenced local variable" warning, 2024-11-11 00:03:34 +03:00
Wayne Stambaugh 24f82ab87d Another attempt to fix Windows file URLs for PDF links.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250

(cherry picked from commit 6cc5d89838)
2024-11-10 10:17:27 -05:00
Wayne Stambaugh bcf069699d Fix PDF plotter URI issues.
Add 'file:' URI JavaScript handlers.

Properly convert Windows file paths to valid URI syntax.

Use expanded variables for URI menu names.

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

(cherry picked from commit 930407fac8)
2024-11-08 14:55:40 -05:00
Wayne Stambaugh f8d694e4d0 Substitute variables in PDF plotter URI links and add file:// URI handler.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250

(cherry picked from commit 43c3cd57eb)
2024-11-08 14:55:19 -05:00
John Beard b80334baa1 Libgit2: the const git_commit* saga continues
The change wasn't re-reverted in 1.8.3, it was just not
included. It was than _also_ reverted in 1.8.4, as it was for
1.8.2 (those two tags are on different branches - main and maint/v1.8).

Hopefully, this means that we're done here, and v1.8.5 will also be
const-y, whether it is based on main or maint/v1.8.

The current state of play:

* 1.7.0 and older: const
* 1.8.0, 1.8.1:    no const
* 1.8.2:           const
* 1.8.3:           no const
* 1.8.4:           const
Future:
* 1.8.5/1.9.0:     presumably/hopefully, const

This is currently breaking at least Arch and Fedora Rawhide

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19062
(cherry picked from commit 9f579f787b)
2024-11-08 08:24:59 +08:00
Jan Wichmann 6c359e2f06 Fix: Clear drill holes table before loading board file
From master branch
2024-11-07 16:56:18 +01:00
Jeff Young a3eff548b7 Even the orphaned net must obey the min board clearance.
(And other Default netclass constraints.)

(cherry picked from commit 5d656e3c8d)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19051
2024-11-05 21:02:23 +08:00
Mark Roszko e33a732371 Bump vcpkg and wxwidgets for aui patch 2024-11-02 19:23:47 +00:00
Jon Evans 95d3200a3a Clear unknown keys from environment variable maps on save
Also fix the previous code for clearing unknown keys to use
a JSON pointer so that it functions correctly when the JSON path
is more than one level deep.

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


(cherry picked from commit 09652efec5)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-11-02 18:54:12 +00:00
Jon Evans 5ee7ae4a45 Make sure to set modified bit when releasing nested settings
(cherry picked from commit 826794469d)
2024-11-02 10:26:03 -04:00
Jon Evans b13a9e231b Use a persistent flag to track JSON modifications
(cherry picked from commit eb6d85bacf)
2024-11-02 10:25:59 -04:00
Seth Hillbrand 1011f361fd Update translations 2024-11-01 16:27:28 -07:00
David Chorváth 288a08b9c2 Translated using Weblate (Slovak)
Currently translated at 65.0% (5974 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-11-02 00:26:56 +01:00
ZbeeGin cac1979f61 Translated using Weblate (Polish)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-11-02 00:26:56 +01:00
Pferd O 38a9477423 Translated using Weblate (German)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:56 +01:00
David Chorváth 072446e79d Translated using Weblate (Slovak)
Currently translated at 64.8% (5961 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-11-02 00:26:56 +01:00
Pferd O 4fc528819d Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:56 +01:00
CloverGit d5f52000ce Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-11-02 00:26:56 +01:00
Henrik Kauhanen 8e4d7da4ea Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-11-02 00:26:55 +01:00
Henrik Kauhanen ea3f0bada4 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-11-02 00:26:55 +01:00
co8 j 3b33ce8bcc Translated using Weblate (Japanese)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-11-02 00:26:55 +01:00
Pferd O 74b42f1bb2 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:55 +01:00
Pferd O b455a4cd54 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:55 +01:00
co8 j 5021f6ee26 Translated using Weblate (Japanese)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-11-02 00:26:55 +01:00
sergio 0be2b88f5a Translated using Weblate (Russian)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-11-02 00:26:55 +01:00
Wellington Terumi Uemura f3a57cf763 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-11-02 00:26:55 +01:00
Pferd O ddd69019bc Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:55 +01:00
109247019824 94e34cb1eb Translated using Weblate (Bulgarian)
Currently translated at 7.6% (706 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/bg/
2024-11-02 00:26:55 +01:00
JamesJCode 6470212edd Fix missed rows when pasting to WX_GRID on macOS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18916

(cherry picked from commit 816af9562b)
2024-11-01 23:10:26 +00:00
Mike Williams 8c3bcade1c schematic: fix missing actions strings and hotkey conflict
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17694
(cherry picked from commit 5ed80a08b8)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18748
2024-11-01 13:37:53 -07:00
jean-pierre charras 70e99acce6 FP editor: fix possible crash when saving a footprint due to a null pointer
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19018
2024-11-01 20:56:42 +01:00
jean-pierre charras 25be138ac1 eeschema, DIALOG_SHEET_PROPERTIES: add test for valid sheet filename
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18981
2024-11-01 20:24:50 +01:00
Alex Shvartzkop 9f196d2e64 EasyEDA/LCEDA: import bezier curves in symbols.
See https://gitlab.com/kicad/code/kicad/-/issues/19034
2024-11-01 16:36:45 +03:00
Alex Shvartzkop b51fed4118 EasyEDA/LCEDA Pro: don't import empty but visible netlabels.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19034
2024-11-01 16:10:15 +03:00
JamesJCode a914f361d3 Fix libgit integration for version >= 1.8.3
The API continues to change...

(cherry picked from commit 75c2f17b42)
2024-10-31 18:48:10 +00:00
Alex Shvartzkop 846b634e0e EasyEDA/LCEDA import: take symbol/netport Name from device entry if empty in schematic.
Also fixes netport orientation if it's symbol is non-default.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19021
2024-10-30 18:33:42 +03:00
Alex Shvartzkop 08b54e205d Show failing strings in HTMLEscape test.
(cherry picked from commit 0581423d50)
2024-10-30 10:37:01 +03:00
Alex Shvartzkop 7cba1e1a55 Update field order in PCB_TUNING_PATTERN.
(cherry picked from commit d2c33e186e)
2024-10-30 10:36:53 +03:00
Alex Shvartzkop 6ae334a751 Fix/improve HTML unescape function.
Also adds some tests.
2024-10-30 08:22:38 +03:00
Alex Shvartzkop 61687e8499 QA: do not pass negative char values to isdigit in NUMERIC_EVALUATOR.
This causes an assert failure on MSVC when running qa_common.
2024-10-30 08:22:38 +03:00
Seth Hillbrand e014f2274f Fix display of broken fonts
TTF fonts are supposed to obey a specific winding.  But sometimes they
don't, especially with garbage windows font editing programs.  If the
outline with hole winding doesn't have an outline, it is probably an
outline itself

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

(cherry picked from commit a6b25d1ee1)
2024-10-29 11:02:26 -07:00
Jeff Young 7e0f05f991 Must check for implicit min separately from opt/max.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19012

(cherry picked from commit 7074c31374)
2024-10-29 17:01:45 +00:00
Jeff Young 1e21b41be5 Centralize ref-des error checking.
(cherry picked from commit 905eaa79a9)
2024-10-28 19:03:50 +00:00
Mark Roszko 4a7dcfdd1f Update vcpkg.json 2024-10-27 23:43:15 +00:00
Alex Shvartzkop d1684b8a72 Fix compatibility with LCEDA/EasyEDA v2.2.32
Now device attributes can contain numbers.

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

(cherry picked from commit 840b9aebba)
2024-10-27 04:30:59 +03:00
Troy Denton 8da026baff Fix URI environment variable expansion issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18918

(cherry picked from commit 0f33aebe48)
2024-10-24 11:53:41 -04:00
jean-pierre charras 89a3ead51e Pcbnew: fix text position when drawing PCB_TEXTs on non paired layers
For these texts, and when the view was "flip board view" option, these text
positions were incorrectly calculated for texts having a text rotation not 0.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18980
2024-10-24 15:20:33 +02:00
jean-pierre charras 5064834716 French translation update 2024-10-24 14:09:49 +02:00
Seth Hillbrand 51a3859d7e Preserve pin numbering when duplicating
We renumber duplicated pins but the previous order was essentially
random.  This keeps the numeric order of the pins on the screen, falling
back to position if they are not numbered

(cherry picked from commit f4bec843d4)
2024-10-21 14:00:18 -07:00
Seth Hillbrand bf37bd8ed5 Fix DRC error with arcs
When two arcs only barely overlapped, we cannot predict the actual point
ends as they exist in the error margins.  Since arc tracks have
different radii by definition, rounding errors in calculating the
overlap angle led to some mistaken identification of parallel segments.

This adds an advanced config flag to set the preferred cutoff point
(currently 0.001°) for whether two arcs actually overlap in shared angle
space

(cherry picked from commit 6be6680d8c)
2024-10-21 13:41:25 -07:00
Dhineshkumar S 283fed83c3 Fix Focus Issue in Parent Window After Hiding the Search Panel
Previously, when the search panel was hidden, the focused search control
did not lose focus, causing an inability to focus on any items in the
parent window when using shortcut keys. This forces correct focus back to the edit window

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

(cherry picked from commit 2bee6f2549)
2024-10-21 13:36:29 -07:00
jean-pierre charras 48983dd31d Python script: Ensure image handlers are loaded before loading a board,.
because a board can include bitmap images using various formats, all
available image handlers must be loaded.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18959
2024-10-21 17:33:14 +02:00
jean-pierre charras ccd4b0cf05 pagelayout_editor: lock panel update during widgets rebuild.
The rebuild is much faster.
From master branch
2024-10-21 17:21:04 +02:00
aris-kimi 154c755a1b Fix non working Esc when init Polyline Properties dialog.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18850
(cherry picked from commit 36bac3f467)
2024-10-20 12:53:34 +01:00
Jeff Young 4157d3350e Limit fix to MacOS.
GTK definitely doesn't need it.  It's unlikely that
MSW needs it either.
2024-10-19 16:49:21 +01:00
Jeff Young 08ba185003 Make sure Paste can't leak through modal dialog.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18912

(cherry picked from commit f1ff75f969)
2024-10-19 16:49:21 +01:00
Jeff Young 7b0e5cd080 DRCEpsilon will appear on *both* sides of a zone neck.
Also don't hide modification of minWidth as a side-effect
of an if-statement.

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

(cherry picked from commit b342126ff3)
2024-10-19 16:49:21 +01:00
Jeff Young 66f50d0c0b A neck in a zone fill will be DRCEpsilon smaller on each side.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18921

(cherry picked from commit 4089735c28)
2024-10-19 16:49:21 +01:00
Jeff Young 973d2d6c03 Even the orphaned net must obey the min board clearance.
(And other Default netclass constraints.)

(cherry picked from commit 4601503660)
2024-10-19 16:49:21 +01:00
Jeff Young fa854b80da Don't ask about locking twice.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18679

(cherry picked from commit a9f79093be)
2024-10-19 16:49:21 +01:00
Jeff Young 05f8bc05ec Fix broken logic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18580

(cherry picked from commit e5321f7401)
2024-10-19 16:49:21 +01:00
Jeff Young d9af68b910 Report implicit rule minimums as being from the board setup.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18642

(cherry picked from commit ed268c5701)
2024-10-19 16:49:21 +01:00
Seth Hillbrand 0c8172880f Prevent soldermask bridge DRC error with mask pad
We checked logical pad matching when looking at pad-based mask but we
should also do the same for aperture masks
2024-10-18 15:24:21 -07:00
Seth Hillbrand 45559cb809 Update translations 2024-10-16 15:32:27 -07:00
Ivan Chuba d3e1d94046 Translated using Weblate (Ukrainian)
Currently translated at 87.0% (7998 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/uk/
2024-10-17 00:31:56 +02:00
Jan Straka 2c75396b80 Translated using Weblate (Czech)
Currently translated at 84.1% (7735 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-10-17 00:31:56 +02:00
Arnau Llovet Vidal 7aae0a9f65 Translated using Weblate (Catalan)
Currently translated at 47.4% (4365 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ca/
2024-10-17 00:31:56 +02:00
Flórián Fuszkó bfd6d96ffc Translated using Weblate (Hungarian)
Currently translated at 3.4% (320 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/hu/
2024-10-17 00:31:56 +02:00
Pferd O f4efa47fe7 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-10-17 00:31:56 +02:00
co8 j d1fd8b18ad Translated using Weblate (Japanese)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-10-17 00:31:56 +02:00
Karl SCHUH 5ee1c0ab42 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-10-17 00:31:56 +02:00
co8 j 8d53326021 Translated using Weblate (Japanese)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-10-17 00:31:55 +02:00
CloverGit 246afee56e Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-10-17 00:31:55 +02:00
taotieren 352faf526f Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-10-17 00:31:55 +02:00
Wellington Terumi Uemura c183a63c50 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-10-17 00:31:55 +02:00
Pferd O 9c34432b99 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-10-17 00:31:55 +02:00
CloverGit 76bc0e27fc Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-10-17 00:31:55 +02:00
Petr Pazourek b2f6d341dd Translated using Weblate (Czech)
Currently translated at 84.1% (7735 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-10-17 00:31:55 +02:00
JamesJCode 7b5afe805e Drag NC markers attached to SCH_SHEET pins when SCH_SHEET is dragged
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18854

(Cherry-picked from commit d726097a3f)
2024-10-14 00:02:05 +01:00
Wayne Stambaugh b77a591c45 Begin version 8.0.7 development. 2024-10-13 18:20:51 -04:00
Wayne Stambaugh 3adec39b0c Tag stable version 8.0.6. 2024-10-13 15:12:40 -04:00
jean-pierre charras a0ad6add34 DIALOG_BOARD_STATISTICS: do not take in account edge.Cuts items thickness
To define the physical board size, graphic items thickness has no matter.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18470
2024-10-12 19:06:45 +00:00
jean-pierre charras 80079c16e8 Pcbnew: ensure all local settings are saved on close the board editor.
From master branch.
2024-10-12 14:05:58 +02:00
jean-pierre charras 632ae136d8 Gerbview: make buffer to read a line of Gerber file bigger.
Currently, the Gerber file is parsed line by line, This is most of time OK.
But warning: in rare cases some files can have *very long* lines (in fact
have only one line),  so the buffer must be very large.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18890
2024-10-10 18:36:20 +02:00
jean-pierre charras 88b11ef065 PCB_DRAW_PANEL_GAL: Ensure LAYER_CONFLICTS_SHADOW is on top of displayed layers.
The visibility of conflicts is better.
2024-10-10 14:27:30 +02:00
Alex Shvartzkop 63b89688df Support libgit2 v1.8.2+
In v1.8.2-rc1, the type change introduced in v1.8.0 was reverted.

See https://github.com/libgit2/libgit2/commit/49d3fadfca4ce8e7a643525eb301a2d45956641e

(cherry picked from commits 74e15a3fc2 and 4c196e1486)
2024-10-07 17:25:58 +03:00
Wayne Stambaugh ab9a4295a0 Tag stable version 8.0.6 release candidate 1. 2024-10-06 15:39:47 -04:00
Alex Shvartzkop e6ce4eb73e Altium PCB: convert small arcs in line chain to segments to avoid overflow issues.
Can be seen on "mb1932-bdp", for example.
2024-10-06 13:43:16 +03:00
Alex Shvartzkop 86f122416b Altium PCB: improve default textbox alignment when isJustificationValid flag is not set.
While there is an example where the default text frame justification is center-center,
in other cases it should be left-bottom, but we don't know what controls this yet.

An example where text frames should be imported with center-center justification:
https://github.com/FpgaDigital/RK3328/blob/830d51b80c77aba6c7570d273521770dfeeee0f9/RK3328.PcbDoc

But in "mb1897-bdp.zip" from https://gitlab.com/kicad/code/kicad/-/issues/18784
text frames should use left-bottom justification.
2024-10-06 13:31:22 +03:00
Alex Shvartzkop be91576758 Altium PCB: support having 103 remaining bytes in ATEXT6 subrecord.
This improves text justification. For example, in:
https://github.com/peng-zhihui/Project-Quantum/blob/71654ca4e4d309e45997a75821f18d0186a08c00/1.Hardware/Electron-Aduino/Electron.PcbDoc
2024-10-06 12:58:26 +03:00
Alex Shvartzkop 784c2cda5a Decode UTF-8 for component field values in backannotation parser.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18406
2024-10-06 12:03:33 +03:00
Mark Roszko 836de8d233 Bump kicad-vcpkg for wx
(cherry picked from commit 04cc05645f)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-10-05 11:39:24 +00:00
Wayne Stambaugh ac01d1986f Remove debugging output from last commit.
(cherry picked from commit 90ed4bae99)
2024-10-04 12:24:17 -04:00
Wayne Stambaugh 8a0693d328 Show schematic parity tab in DRC dialog when parity marker is selected.
(cherry picked from commit 7228321b5d)
2024-10-04 12:23:14 -04:00
Wayne Stambaugh 2a62ffe32d Update hierarchy navigator when sheet schematic file is changed. 2024-10-03 12:29:00 -04:00
Wayne Stambaugh cb895c9710 Fix schematic hierarchy navigator refresh issues.
The hierarchy navigator was failing to update properly on undo/redo and
when the referenced schematic file of a sheet was changed.

(cherry picked from commit a871311b6f)
2024-10-03 10:14:58 -04:00
John Beard 52a73986bc Pcbnew: Fix aligned dimension flipping
https://gitlab.com/kicad/code/kicad/-/issues/16317
(cherry picked from commit 304d9e0006)
2024-10-03 14:31:21 +01:00
Mark Roszko 15582773bd Update our vcpkg ports 2024-10-02 22:03:28 +00:00
Wayne Stambaugh fc3435113d Fix annotation issue loading legacy schematics.
Commit 83de056de9 broke loading legacy schematics that are not shared.
Legacy schematics do not contain instance data "AR Path=" entries when
the schematic file was not shared.  The reference and unit information
was only stored in the symbol reference field and unit entries in the
symbol definition.

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

(cherry picked from commit 21dd41eeb2)
2024-10-02 11:16:09 -04:00
jean-pierre charras 801492b708 Add forgotten fix in commit 8c25e5b6 2024-09-30 20:45:31 +02:00
jean-pierre charras 8c25e5b68e kicad-cli: ensure plotted layers in gerber export are restricted to enabled layers
From branch
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18811
2024-09-30 19:37:28 +02:00
Seth Hillbrand 1525da154f Update translations 2024-09-30 08:42:37 -07:00
Pferd O f2199eebf5 Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-30 17:42:06 +02:00
boonchai k 1a761bf6ce Translated using Weblate (Thai)
Currently translated at 71.7% (6593 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/th/
2024-09-30 17:42:06 +02:00
CloverGit 21f8b23ade Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-30 17:42:06 +02:00
Pferd O 4fc82b97cf Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-30 17:42:06 +02:00
ssantos 721e7359b3 Translated using Weblate (Portuguese)
Currently translated at 99.9% (9182 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt/
2024-09-30 17:42:06 +02:00
co8 j 7e0c822451 Translated using Weblate (Japanese)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:06 +02:00
co8 j 6d9160ea31 Translated using Weblate (Japanese)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:06 +02:00
co8 j 31cc51fe42 Translated using Weblate (Japanese)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:06 +02:00
Pferd O c85ef81e6b Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-30 17:42:06 +02:00
CloverGit ddb29d6ab8 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-30 17:42:06 +02:00
Toni Laiho d666021572 Translated using Weblate (Finnish)
Currently translated at 99.8% (9175 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-09-30 17:42:05 +02:00
Frank Sonnenberg 360d6d87a4 Translated using Weblate (German)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-30 17:42:05 +02:00
CloverGit 97d3b369d5 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-30 17:42:05 +02:00
Trần Phi Hải 7936df3e1e Translated using Weblate (Vietnamese)
Currently translated at 26.1% (2408 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-09-30 17:42:05 +02:00
Trần Phi Hải eca370792a Translated using Weblate (Vietnamese)
Currently translated at 25.4% (2339 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-09-30 17:42:05 +02:00
Henrik Kauhanen af68514acd Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-30 17:42:05 +02:00
ZbeeGin a0e0f05977 Translated using Weblate (Polish)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-30 17:42:05 +02:00
co8 j 78c09b1e2f Translated using Weblate (Japanese)
Currently translated at 99.9% (9188 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:05 +02:00
Trần Phi Hải a2051132b5 Translated using Weblate (Vietnamese)
Currently translated at 23.7% (2187 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-09-30 17:42:05 +02:00
CloverGit a67bf40def Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-30 17:42:05 +02:00
Wellington Terumi Uemura 9b47650b4a Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-09-30 17:42:05 +02:00
Tokita, Hiroshi 748dd4f02c Translated using Weblate (Japanese)
Currently translated at 99.5% (9153 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:05 +02:00
Henrik Kauhanen 530167cf69 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-30 17:42:04 +02:00
jeong-sangwon 7d6e8853db Translated using Weblate (Korean)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-09-30 17:42:04 +02:00
Jon Evans 9f3631f0e9 Revert "Add ERROR_LOC to exports"
This reverts commit c8253a5018
2024-09-29 14:31:26 +00:00
Jon Evans c8253a5018 Add ERROR_LOC to exports
(cherry picked from commit 330150a6a6)

Co-authored-by: i404788 <404788@student.fontys.nl>
2024-09-29 13:36:26 +00:00
jean-pierre charras 3aaae7405d Pcbnew, Flip rectangle shape: Keep its anchor position after flipping.
Previously, it was flipped using the shape anchor position. But for this
shape, the anchor (top left corner)) is reinitialized after flipping, so
flipping twice moves the shape.
Now the rectangle center is used as reference position to flip the shape
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18797
2024-09-28 18:17:00 +02:00
jean-pierre charras f2e012119a Pcbnew: Fix issue when flipping a graphic segment (SHAPE_T::SEGMENT).
PCB_SHAPE::Normalize() normalized a graphic segment by (sometimes) swapping
start and end points. But it creates an issue when flipping a segment: the
reference point can be changed.
This normalization was made for DRC purpose when comparing 2 footprints.
Now, PCB_SHAPE::Normalize() does not change end points of a segment, and a
specific PCB_SHAPE::NormalizeForCompare() normalize fct is used for DRC compare.
2024-09-28 17:55:00 +02:00
JamesJCode 48b9027842 Fix deep cloning and RunOnDescendants for groups containing generators
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17710

(Cherry-picked from 903c743a60)
2024-09-26 19:03:32 +01:00
John Beard 0511926a4c Pcbnew: handle connected copper circle points
V8 inline implementation of aea42a5cdf,
since no KIGEOM helper functions.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18774
2024-09-25 18:43:29 +01:00
jean-pierre charras 1ac1a5bb3b Symbol Editor, align items on grid: do not modify shape of arcs and circles.
Previously, start and end points were moved, and therefore the shape itself was
modified. It was probably unexpected.
Now just align the arc start point or the circle center point on grid.
2024-09-21 18:09:48 +02:00
jean-pierre charras 6cfe4482f7 Simulator, TUNER_SLIDER: fix (minor) issues
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18746
2024-09-21 18:09:48 +02:00
jean-pierre charras 61680eacd4 PANEL_SETUP_LAYERS: fix issues for VIAs when reducing the copper layer count.
From master branch.
2024-09-21 18:09:48 +02:00
Wayne Stambaugh 3aef3818cd Fix broken library symbol links when importing CADSTAR schematics.
Under certain circumstances, the library symbol links were missing
the library nickname causing the schematic symbols to appear as if
the library symbol was missing.

Added a helper function to create the symbol library name to avoid
code duplication.

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

(cherry picked from commit 7acd057c86)
2024-09-21 11:51:03 -04:00
JamesJCode 355805756e Enable 'exclude_from_sim' property for DB libraries
(Cherry-picked from commit df869036e5)
2024-09-17 21:07:55 +01:00
jean-pierre charras 96acf00e81 fix incorrect code committed in commit 1dcd65ec 2024-09-17 15:27:31 +02:00
jean-pierre charras 1ad4fb2eea Convert graphic to polygon or zone: fix some issues:
- fix gap added twice
- add missing gap setting in DIALOG_COPPER_ZONE and DIALOG_NON_COPPER_ZONES_EDITOR

From master branch
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18724
2024-09-17 14:21:16 +02:00
jean-pierre charras 1dcd65ec71 3D viewer, minor fix: vias not fully displayed when the top layer was not shown.
From master branch.
2024-09-14 17:04:22 +02:00
jean-pierre charras 1109878da0 Pcbnew: Preferences/Fp editor/Default values: allow to remove defaut text items.
These texts/fields are not mandatory, so allow remove them from default texts list.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18663
2024-09-14 16:31:03 +02:00
jean-pierre charras 7a0803f384 PCB_DRAW_PANEL_GAL: Use TARGET_OVERLAY for LAYER_CONFLICTS_SHADOW.
This is a better option than TARGET_NON_CACHED, and giving better look.
2024-09-14 16:31:03 +02:00
jean-pierre charras 8f56d0b38e DRC and flipped Fp: the sorting function used by DRC now normalize segments.
From master branch
2024-09-14 16:31:02 +02:00
Wayne Stambaugh 9309f612ef Fix incorrect warning coordinates when updating board from schematic.
Use the X and Y axis inversion preference settings in the "PCB Editor"
"Origin & Axes" panel to invert the internal coordinates to display to
the user.

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

(cherry picked from commit 64d4dbb2e8)
2024-09-11 12:06:08 -04:00
Alex Shvartzkop d2b13060fe Fix build error due to SIM_MODEL_IBIS.
SIM_MODEL_KIBIS was renamed to SIM_MODEL_IBIS in master in commit 4e133ae83b,
but not in 8.0.
2024-09-11 15:04:31 +03:00
Seth Hillbrand 393a72216e Limit where type overrides can happen
IBIS requires the ability to override types but this is explicitly
forbidden to SPICE subcircuits.

(cherry picked from commit e01246a9d3)
2024-09-10 15:56:19 -07:00
Seth Hillbrand 76e50881fb Handle field types missing
If we do not have both a device and type for the sim model, return none
because we cannot parse it.  This is handled by the calling routines.
Otherwise, we would return raw spice type erroneously.
2024-09-10 12:25:31 -07:00
John Beard 9779ee0fd3 Fix Boost 1.86 SHA1 one last time
There's a change in Boost 1.86 that breaks the SHA1 hashing
in 3D cache.

The master KiCad branch ditches SHA1 entirely here, but it's quite
an invasive change to backport. So apply a sticking plaster for
the remainder of v8.

Relates-To: https://gitlab.archlinux.org/archlinux/packaging/packages/kicad/-/issues/1
2024-09-10 12:10:33 +01:00
John Beard 9fdd825681 KIID: Use Boost uuids own hash function (fix Boost 1.86)
Not only is this simpler, but it should be compatible
with all Boost versions (the cast is a problem in 1.86)
and it was also 'improved' in 1.86 for better mixing.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18651
(cherry picked from commit 9a3ebfba40)
2024-09-08 22:49:53 +01:00
Ian McInerney f4f9513f80 Fix compilation with Boost 1.86
Boost 1.86 removed the boost::random dependency from boost::uuid, so
we need to include those headers on our own now to use the random
mersenne twister implementation.

(cherry picked from commit a9e115925a)
2024-09-07 20:05:00 +01:00
Jeff Young d35431c888 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

(cherry picked from commit b549c4feec)
2024-09-07 17:59:24 +01:00
Jeff Young bcb7acf5c2 Use ORIGIN_TRANSFORMS in Mover Corner To... dialog.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18479

(cherry picked from commit e6a5669d02)
2024-09-07 17:01:42 +01:00
Jeff Young 1e82ed302d Fix some contrast and update issues with sim cursors.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18390

(cherry picked from commit e3d4137521)
2024-09-07 17:01:11 +01:00
Jeff Young 1fde8ea6f5 Improve PIN_TRICKS to handle pins with no names.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18535

(cherry picked from commit 528b74db7f)
2024-09-07 17:00:14 +01:00
John Beard dab3a38815 Satisfy Boost version polyfils in 8.0 2024-09-07 14:06:45 +01:00
John Beard c9db8f6bfc LSET doesn't have list ctor in 8.0 2024-09-07 13:08:29 +01:00
John Beard 3c655836df SEG: Correct sign in LineDistance
(cherry picked from commit 78cb6c1189)
2024-09-07 11:59:42 +01:00
Jon Evans 544b235910 Fix PNS log viewer after 03079a4f
(cherry picked from commit 0a816ce079)
2024-09-07 12:52:11 +03:00
Alex Shvartzkop bf34bf24ab Make simulation reporter warnings non-fatal.
Adds REPORTER::HasMessageOfSeverity for WX_STRING_REPORTER,
which allows us to show simulation warnings and fail only if there's errors.

Also fixes a crash when SPICE_GENERATOR_KIBIS throws an IO_ERROR.

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

(cherry picked from commit 36019314e9)
2024-09-07 12:38:27 +03:00
Alex Shvartzkop 6b199c52a1 Import POURED items as zone fills from EasyEDA/LCEDA Pro v2.2+ PCBs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18664
2024-09-07 12:23:05 +03:00
John Beard 94f667d87f Pcbnew: set mirrored when creating on back layer
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18643
(cherry picked from commit 9fac24fa0f)
2024-09-06 23:01:38 +01:00
John Beard 464c3815b9 Pcbnew: Ensure items are rescued to an enabled layer
(cherry picked from commit f78329e2af)

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18553
2024-09-06 21:59:12 +01:00
John Beard 53732e2276 Pcbnew: handle all zone layers when rescuing items
(cherry picked from commit 2befd31fd6)

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18553
2024-09-06 21:59:11 +01:00
John Beard bd554a5808 Pcbnew: don't assume zones are in the UiOrder list
This can be false, for example when zones are being rescued,
even if the LSET is non-zero-sized.

(cherry picked from commit 1662d7f546)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18553
2024-09-06 21:59:11 +01:00
JamesJCode b48051d52f PNS: Update track widths during routing
(Cherry-picked from commit 3f2b6f7ae0)
This allows routing through, for example, neck downs defined
based on courtyard DRC rules
2024-09-06 19:18:20 +01:00
JamesJCode 03079a4f4f PNS: Check for nearest segment anchor for initial track constraints
(Based on cherry-pick from commit c39551b032)
2024-09-06 19:18:20 +01:00
JamesJCode 6daa857c2d Mask PCB_TEXTBOX properties that are not supported
Masks EDA_SHAPE "Filled" property for PCB_TEXTBOX objects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18640
2024-09-06 19:18:20 +01:00
Wayne Stambaugh 5a1f60a7c6 Begin version 8.0.6 development. 2024-09-06 12:30:24 -04:00
Wayne Stambaugh e8553dcdf7 Tag stable version 8.0.5. 2024-09-06 12:28:40 -04:00
Alex Shvartzkop dc3012933a Restore a string in Altium parser. 2024-09-06 19:13:28 +03:00
Seth Hillbrand 291ff615bc Update translations 2024-09-06 09:03:13 -07:00
Hanna Breisand 26d1080e52 Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
Oliver0804 c1452a24d2 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.3% (9127 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-09-06 18:02:20 +02:00
Hanna Breisand 34c833966f Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
Julio Dias f0e1bc3562 Translated using Weblate (Portuguese)
Currently translated at 99.1% (9111 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt/
2024-09-06 18:02:20 +02:00
Allan Nordhøy 6da9034322 Translated using Weblate (Norwegian Bokmål)
Currently translated at 48.6% (4467 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nb_NO/
2024-09-06 18:02:20 +02:00
김랑기 6887e8cbe3 Translated using Weblate (Korean)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-09-06 18:02:20 +02:00
Hanna Breisand 89ef5986e7 Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
김랑기 5572a72bb3 Translated using Weblate (Korean)
Currently translated at 99.5% (9152 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-09-06 18:02:20 +02:00
Tokita, Hiroshi b40e446149 Translated using Weblate (Japanese)
Currently translated at 99.5% (9150 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-06 18:02:20 +02:00
Toni Laiho 757bfd7b32 Translated using Weblate (Finnish)
Currently translated at 99.7% (9165 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-09-06 18:02:20 +02:00
Henrik Kauhanen c5e1c3db62 Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
dsa-t b25ff44ff7 Translated using Weblate (Russian)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-09-06 18:02:20 +02:00
Jan Straka cad7a18fa0 Translated using Weblate (Czech)
Currently translated at 84.1% (7731 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-09-06 18:02:20 +02:00
CloverGit 1c3637cb33 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-06 18:02:20 +02:00
Hanna Breisand 3a5f84d1ec Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
Henrik Kauhanen 44f8df592b Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
CloverGit 17e19f8652 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9188 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-06 18:02:19 +02:00
Hanna Breisand 34fe104431 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Henrik Kauhanen 2bdb155838 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Andrej Valek 22ebade907 Translated using Weblate (Slovak)
Currently translated at 64.7% (5955 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-09-06 18:02:19 +02:00
Dmitry Mikhirev 9d594214fe Translated using Weblate (Russian)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-09-06 18:02:19 +02:00
Peter B 2c89717c0a Translated using Weblate (Romanian)
Currently translated at 27.1% (2491 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ro/
2024-09-06 18:02:19 +02:00
Grzegorz Szymaszek 7574a46a19 Translated using Weblate (Polish)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-06 18:02:19 +02:00
ZbeeGin e5c4d75ce1 Translated using Weblate (Polish)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-06 18:02:19 +02:00
CJ van der Hoeven f038ee3083 Translated using Weblate (Dutch)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-09-06 18:02:19 +02:00
Pferd O e1ab2a0836 Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-06 18:02:19 +02:00
CloverGit 9070d9ff22 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.8% (9181 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-06 18:02:19 +02:00
Henrik Kauhanen 606c19780d Translated using Weblate (Swedish)
Currently translated at 99.7% (9172 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Hanna Breisand 8fecebb209 Translated using Weblate (Swedish)
Currently translated at 99.7% (9172 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Peter B da8e1be1c8 Translated using Weblate (Romanian)
Currently translated at 27.0% (2490 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ro/
2024-09-06 18:02:18 +02:00
Wellington Terumi Uemura e14a3caf18 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-09-06 18:02:18 +02:00
Marek 5afb3ad5cc Translated using Weblate (Polish)
Currently translated at 99.9% (9188 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-06 18:02:18 +02:00
Ulices b29ca47f25 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-09-06 18:02:18 +02:00
Alex Shvartzkop 5d1737d654 Fix compatibility with EasyEDA/LCEDA Pro v2.2.26
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18620

(cherry picked from commit 16d9fa7f25)
2024-09-06 16:04:24 +03:00
Alex Shvartzkop bdc371f057 Altium PCB import: fix textbox and text placement.
Especially when rotated and/or mirrored.

It's not perfect but it's close enough to being correct.

See https://gitlab.com/kicad/code/kicad/-/issues/18417
2024-09-05 03:52:22 +03:00
Alex Shvartzkop dc2dd20ec7 Altium PCB import: don't add stroke width to text height.
For stroke fonts, KiCad's metrics are very similar to Altium's,
so there's no need to add more height.
2024-09-05 03:52:18 +03:00
Alex Shvartzkop 057174caa0 Altium PCB import: don't override text alignment in ConvertTexts6ToEdaTextSettings.
It is set already at callsite, no need to override.
2024-09-05 03:52:12 +03:00
Alex Shvartzkop 4b035d5b5c Altium PCB import: convert arcs with very small angle to segments.
See mb1791_bdp.zip for example.
2024-09-05 03:52:08 +03:00
jean-pierre charras b22948988f Fix a side effect of commit 513d659c (master) or 55fafe34 (8.0 branch)
This commit modify the order of end points of flipped graphic lines, and
create a DRC issue for flipped footprints (if flipped before this commit).
For segments inside a footprint, the "old" way to flip a segment is now
reused. Expecting this ugly fix is only temporary.
2024-09-03 16:17:31 +02:00
Seth Hillbrand 7a05d58b3e Fix some textbox imports
We still don't know why some Altiums seem to save 0s for the textbox
size when dealing with text strings and some still save values.  There
must be another flag to differentiate between text strings and text
boxes but we haven't found it yet.  But until then, we still need to
link the correct string with the textbox that we generate and suppress
the border

(cherry picked from commit 5332d44bad)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18502
2024-09-02 16:23:28 -07:00
Jon Evans 695ab290e6 Add swig4.2 for linux platforms find
(cherry picked from commit 723fa57b84)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-08-30 15:28:00 +00:00
Jeff Young 54a373a7e2 Push thickness handling down into EDA_TEXT::SetBold().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17077

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

(cherry picked from commit aef87b9796)
2024-08-28 13:47:29 +01:00
jean-pierre charras 637f331724 French translation update 2024-08-28 14:17:35 +02:00
Wayne Stambaugh 931a9697ca Tag stable version 8.0.5 release candidate 1. 2024-08-26 17:15:42 -04:00
Seth Hillbrand 5ffc58844f Update translations 2024-08-26 14:05:46 -07:00
Hanna Breisand 3ea2c6f1ff Translated using Weblate (Swedish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-08-26 23:03:53 +02:00
Balázs Meskó 2cba724659 Translated using Weblate (Hungarian)
Currently translated at 3.3% (312 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/hu/
2024-08-26 23:03:52 +02:00
Ulices 254260a616 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-08-26 23:03:52 +02:00
Pferd O 45b13d513b Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:52 +02:00
CloverGit ba86c3ac75 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
YÜKSEL AÇIKGÖZ 19d4c31fcc Translated using Weblate (Turkish)
Currently translated at 59.4% (5470 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-08-26 23:03:52 +02:00
CloverGit 160f69d720 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
CloverGit 4fa42960e9 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
CloverGit 9c4ca6da14 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
Jan Straka c113385016 Translated using Weblate (Czech)
Currently translated at 83.8% (7710 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-08-26 23:03:52 +02:00
Henrik Kauhanen 68e37a93ec Translated using Weblate (Swedish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-08-26 23:03:52 +02:00
109247019824 9b158e70f5 Translated using Weblate (Bulgarian)
Currently translated at 7.6% (704 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/bg/
2024-08-26 23:03:52 +02:00
Free_squire ab536192c3 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-08-26 23:03:52 +02:00
Tokita, Hiroshi bc87b0db60 Translated using Weblate (Japanese)
Currently translated at 99.4% (9140 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-08-26 23:03:52 +02:00
ivit VT 981f82db93 Translated using Weblate (Czech)
Currently translated at 82.9% (7624 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-08-26 23:03:52 +02:00
CloverGit b6f5aeba1e Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
CloverGit 4fa34677ea Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:51 +02:00
Ulices c67346991f Translated using Weblate (Spanish (Mexico))
Currently translated at 99.6% (9165 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-08-26 23:03:51 +02:00
Laurens Holst 811de6a462 Translated using Weblate (Dutch)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-08-26 23:03:51 +02:00
YÜKSEL AÇIKGÖZ cfe7992723 Translated using Weblate (Turkish)
Currently translated at 59.3% (5456 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-08-26 23:03:51 +02:00
Pferd O 8c84f2ac23 Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
YÜKSEL AÇIKGÖZ fb23d62b6b Translated using Weblate (Turkish)
Currently translated at 58.5% (5383 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-08-26 23:03:51 +02:00
dsa-t 84f182ef03 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-08-26 23:03:51 +02:00
Ignas Brašiškis 987d151977 Translated using Weblate (Lithuanian)
Currently translated at 50.7% (4670 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/lt/
2024-08-26 23:03:51 +02:00
Toni Laiho c622da5fbf Translated using Weblate (Finnish)
Currently translated at 99.8% (9182 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-08-26 23:03:51 +02:00
Pferd O 19f163b724 Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
ZbeeGin 3fcf207443 Translated using Weblate (Polish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-08-26 23:03:51 +02:00
Pferd O 4814f29fbd Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
Alex Life 39f4ea5ffa Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-08-26 23:03:51 +02:00
tct123 5d08531ecb Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
Pferd O 4a0fdfd2ab Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
CloverGit c88aab3a4f Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:51 +02:00
Seth Hillbrand bf4aebff4d Update Altium importer to use textbox flag
Textboxes in Altium might have intrinsic borders that don't count in
their text width, so we need to buffer this in KiCad

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

(cherry picked from commit ecd27883b6)
2024-08-26 14:02:35 -07:00
Alex Shvartzkop 39627bfcfa Parse more Altium data related to Text6.
(cherry picked from commit 881d0184bb)
2024-08-26 13:22:23 -07:00
jean-pierre charras 55fafe3401 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.
From master branch
2024-08-26 19:50:39 +02:00
jean-pierre charras dd870deec5 RENDER_SETTINGS: try a slightly modified dot calculation. 2024-08-25 17:18:30 +02:00
jean-pierre charras 7ecf18ba80 EEschema, print: fix incorrect sheet order and uninitialized sheet number
The displayed sheet number was not updated.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18594
2024-08-25 16:14:43 +02:00
jean-pierre charras 68e4ccf196 RENDER_SETTINGS: fix issue when using dotted lines.
At some levels, these lines (drawn as dots) were not visible.
They are now drawn as short lines.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16757
2024-08-24 20:48:02 +02:00
jean-pierre charras 0a28398944 Gerbview: fix arc to segment approximation when drawing Regions (polygons)
The approx was 36 segments per 360 deg. But this is not good for arcs having
a small arc angle and a large radius.
The fix uses a max error (currently 5 microns) to calculate the approximation.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18587
2024-08-23 10:47:55 +02:00
jean-pierre charras 27002f568b BOARD::GetBoardPolygonOutlines(): Protect against malformed NPTH pads
In some cases, when modifying a pad (SMD -> NPTH from properties panel, one
can generate a NPTH pad with a zero sized hole. Pcbnew can crash with such a pad,
especially if the 3D viewer is shown during modification.
From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18585
2024-08-22 11:12:47 +02:00
Maciej Suminski 9b5840b7ee Text variable resolving in footprint text boxes
Mostly a code copy from PCB_TEXT::GetShownText() to
PCB_TEXTBOX::GetShownText().

Cherry-picked 5ad5be09 (sans m_ResolveTextRecursionDepth advanced
config, not present in 8.0).
2024-08-17 00:08:14 +00:00
Mark Roszko 5a3f8b4235 Disconnect events in ~ACTION_TOOLBAR 2024-08-16 07:13:39 -04:00
Mark Roszko 7be78d50a4 Unbind events in KISTATUSBAR destructor 2024-08-16 07:04:40 -04:00
Mark Roszko b1f861137e Add missing unbinds to STD_BITMAP_BUTTON 2024-08-16 07:04:35 -04:00
Mark Roszko 3e3a958d4f Add missing unbind to PANEL_KICAD_LAUNCHER 2024-08-16 07:04:30 -04:00
Mark Roszko cc5a3eb61f Disconnect events used in EDA_BASE_FRAME 2024-08-16 07:03:16 -04:00
Mark Roszko eabf2f57aa Don't see horizontal layout on the vertical toolbar
Wild glitching on arm64 Windows revealed this was set, lol.
2024-08-16 07:02:53 -04:00
Mark Roszko 1667b1312e Unbind the char events in KICAD_MANAGER_FRAME destructor 2024-08-16 07:02:15 -04:00
Mark Roszko 1123a25f04 unbind/disconnect in PROJECT_TREE_PANE destructor 2024-08-15 22:26:28 -04:00
Mark Roszko ef757ffd28 Unbind BITMAP_BUTTON events during destruct 2024-08-15 22:26:02 -04:00
JamesJCode f63d018f1c PNS: Use correct diff pair width / gap settings when starting route
(cherry picked from commit 364f6d4213)
2024-08-15 19:52:03 +01:00
Wayne Stambaugh 83de056de9 Fix missing schematic symbol instance data.
This fix adds missing symbol instance data that defaults the instance
data to no annotation which will will trigger a annotation request on
any operations that require a fully annotated schematic.

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

(cherry picked from commit 0cf1110367)
2024-08-15 07:31:25 -04:00
JamesJCode 015906d862 PNS: Include net when querying DRC for initial track width
(cherry picked from commit 67b9170146)
2024-08-15 09:09:06 +01:00
Jan Wichmann c288c469fb pcbnew: The checkbox 'Center on footprint' was not disabled when the actionButton was changed. 2024-08-14 21:40:18 +00:00
JamesJCode 7a8efc1d27 Report track clearance constraint from DRC rule if >= board minimum
(cherry picked from 013fa4824b)
2024-08-14 22:11:35 +01:00
JamesJCode aaaa8a8835 Use correct track width constraint when starting PNS from footprint
(cherry picked from a6a62b1be5)
2024-08-14 22:07:09 +01:00
JamesJCode 2891c580b1 Correctly handle track clearance constraints in router
(cherry picked from 72a0c41e3d)
2024-08-14 21:48:46 +01:00
Seth Hillbrand 97d75ae844 Remove last cherry-pick
Already existed in 8 branch.
2024-08-14 13:41:03 -07:00
Seth Hillbrand 7ccc89196b Avoid losing the last point when simplifying
line chains that are not closed should avoid simplifying between
beginning and end points.  Make sure that we keep the finishing point
for these chains

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

(cherry picked from commit b71eb1186f)
(cherry picked from commit 6ed537753c)
2024-08-14 13:05:40 -07:00
JamesJCode 7774145a8f Update message panel when placing a via with interactive router
(cherry picked from commit 41ff744f1e)
2024-08-14 17:40:19 +01:00
Kacper Słomiński 0bf2d2ca32 Fix build issue with experimental GCC version 15.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18539

(cherry picked from commit e6bcc6d0a6)
2024-08-14 07:48:02 -04:00
jean-pierre charras 6338a69f17 Pcbnew: fix 2 issues after removing a track, especially ending on a teardrop
- Message panel display not always correctly updated (shows an old data)
- Incorrect updated ratsnest is some cases when removing a track ending on
a teardrop.

From master branch.
2024-08-14 08:27:22 +02:00
Jeff Young 5f8ba6f9a1 Revert commit not meant for 8.0. 2024-08-13 21:30:20 -06:00
Jeff Young a53bbd92f5 Don't presume CreatePin/RepeatPin() return something.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18540

(cherry picked from commit 7c4fe35589)
2024-08-13 21:13:07 -06:00
Jeff Young aa71423d5f Fix missing parameter.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18530

(cherry picked from commit 8a487c2c86)
2024-08-13 21:11:23 -06:00
Jeff Young f3ae7afec2 Set sheetpath for ERCE_MISSING_UNIT errors.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18445

(cherry picked from commit 22d37f6c34)
2024-08-13 21:11:15 -06:00
Mark Roszko 29194761e5 Update vcpkg-configuration.json 2024-08-13 23:49:44 +00:00
Jon Evans f56c05ac3e Fix broken cherry-pick 2024-08-12 23:06:56 -04:00
Jon Evans 15256b379c Ensure constraints when changing pad hole properties
Also expose hole shape to properties system

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

(cherry picked from commit c9af2f318f)
2024-08-12 23:06:09 -04:00
Jon Evans b4113decc5 Fixes for snapping in free via placer
Support snapping to graphics at all
Don't skip snapping to pads with no net
Treat placing vias as placing tracks for magnetic settings

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


(cherry picked from commit 960a9ef7d5)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-08-13 02:49:34 +00:00
aris-kimi b249932888 Fixes cherry-pick for 2 previous commits 2024-08-11 21:54:18 +00:00
Jeff Young 6b6057b194 Clean up more exception processing in simulation GUI.
This allows us to more correctly report errors without
dialog issues, logs popping up, etc.

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

7f6ab7043b from master
2024-08-11 21:54:18 +00:00
aris-kimi b9623e9359 Fixes a crash when ctrl+x a kicad var from the field
and leave as a starting char '/'

Also fixes a typo and updates the wxFormBuilder file

e59417aff3 from master
2024-08-11 21:54:18 +00:00
Wayne Stambaugh 735b05ba30 Add '?' to list of forbidden file name characters.
(cherry picked from commit aace2271df)
2024-08-11 07:19:35 -04:00
jean-pierre charras 62724f9cb6 pcbnew, PCB_IO_ALTIUM_DESIGNER: fix issues when converting a lib to kicad format.
- add the patch from RigoLigoRLC
- fix issue with illegal chars in filename the char * was missing in list.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18452
2024-08-11 09:30:22 +02:00
Wayne Stambaugh 2e4dd4bc3f Fix CLI PCB drill export when output path does not end with path separator.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14438

(cherry picked from commit b6734c42f0)
2024-08-07 16:18:25 -04:00
jean-pierre charras 87139ce571 3E viewer: fix incorrect custom pad shape in some cases.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18495
2024-08-06 13:50:25 +02:00
jean-pierre charras 582d2e7bdb PCB_IO_GEDA: fix broken function GetEnumeratedFootprint().
The code was old and not updated to actual io code.
Just removed to use the generic code.
From master branch
2024-08-05 20:21:11 +02:00
Jeff Young 5c89937870 Make target length sticky within a session.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18109

(cherry picked from commit 937854c577)
2024-08-01 14:38:43 +01:00
Jeff Young 412e244d48 Text is a single-click-place.
Also, don't run normal undo code when in the middle of
placing an item.

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

(cherry picked from commit f6c723ba37)
2024-08-01 14:38:38 +01:00
jean-pierre charras 0940565025 DIALOG_SIM_MODEL: fix a focus issue (missing aEvent.Skip()).
From master branch.
2024-07-31 16:45:02 +02:00
jean-pierre charras c5b2e859c1 DRC test: Fix missing filter of DRCE_OVERLAPPING_FOOTPRINTS test.
When the DRCE_OVERLAPPING_FOOTPRINTS tests were disabled, the markers were
still created, because the code that created them did not test if the
DRCE_OVERLAPPING_FOOTPRINTS drc test is enabled or not.
From master branch
2024-07-30 14:21:36 +02:00
jean-pierre charras e06a8131c5 pcbnew: fix a bug when pasting a footprint (after a copy command)
The paste code removed items managed by the footprint when they are not on
an enabled layer.
This is a bug: all items must be kept in the parent footprint.
This is the only one command that tried to remove such items.
Other commands (Ctrl+D, load Footprint and read netlist) do not delete any item

Frm master branch
2024-07-28 20:08:18 +02:00
jean-pierre charras 16dee8608b DIALOG_FOOTPRINT_CHOOSER: fix some min sizes to avoid not visible widgets.
From master branch
2024-07-28 12:31:49 +02:00
Jeff Young 396e531e7c Cleanup. 2024-07-23 11:36:56 +01:00
Jeff Young 24c234fd93 Don't attempt to rename field more than once.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18330

(cherry picked from commit e9d376c912)
2024-07-23 11:36:56 +01:00
Jeff Young fdbe35e20c Give padstack warning violation a name.
Also regularises capitalisation & parens in some error
messages.

Also de-duplicates hole testing for PTH pads, and SMD
rationality testing.

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

(cherry picked from commit 8b948e7b9c)
2024-07-23 11:36:56 +01:00
Jeff Young cc3e3ee34c Clear fields when flag is set.
Also make sure we set aUpdated when deleting extra
text items or fields, and when updating fabrication
attributes or 3D models.

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

(cherry picked from commit dab3972165)
2024-07-23 11:36:56 +01:00
Jeff Young d0da1725ca Allow deleting text item out of parent footprint in PCB editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18425

(cherry picked from commit 87ee56b582)
2024-07-23 11:36:56 +01:00
Alex Shvartzkop 7e115249af Hide notification panel on focus loss.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17295
2024-07-22 13:33:08 +03:00
Jeff Young 07e8edfcdf Remove asserts for valid states.
(A pin won't have a connection until after the connection
graph has been rebuilt.)

KICAD-6S1

(cherry picked from commit c378e6f690)
2024-07-21 21:01:14 +01:00
Jeff Young cbb2c187bd Fix scoping of lock.
(cherry picked from commit d5c7ac5065)
2024-07-21 21:01:14 +01:00
Alex Shvartzkop 011018b002 Improve alignment of KiCad 16/24/32 px icons.
(cherry picked from commit 5b2ea411f8)
2024-07-21 21:29:42 +03:00
Alex Shvartzkop d3a44607e6 Generate hidpi variants for mid size (_24) application icons.
(cherry picked from commit 0e66adbca1)
2024-07-21 21:29:42 +03:00
Jeff Young 1ad3532740 Ooops. That commit wasn't for 8.0 (as the var doesn't exist there). 2024-07-21 13:40:14 +01:00
Jeff Young 26caad8b35 Tidy up string find API usages.
(cherry picked from commit bab97f91cc)
2024-07-21 13:40:14 +01:00
Alex Shvartzkop f1da2e90d7 Fix EasyEDA/JLCEDA Pro 2.2 footprint/symbol library import.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18250

(cherry picked from commit 1613816e77)
2024-07-21 15:38:57 +03:00
Alex Shvartzkop 59492bd947 Add mutex include.
(cherry picked from commit cc96de29e6)
2024-07-21 15:26:58 +03:00
Jeff Young 7b96cc3d0c Hand-cherry-pick some fixes from master. 2024-07-21 13:22:01 +01:00
Jeff Young df873158bc Slight increase to round-off error tolerance.
(It's now 2nm, which is still significantly below the
clearance DRC epsilon of 500nm.  It's also what we
already use in EDA_SHAPE.)

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

(cherry picked from commit c8e8545e47)
2024-07-21 13:22:01 +01:00
Jeff Young f88e1aa279 Fix uninitialized variable.
(cherry picked from commit 1833330e5c)
2024-07-21 13:22:01 +01:00
Alex Shvartzkop a02f12c68a std::set::contains is C++20-only, use find instead. 2024-07-21 15:18:44 +03:00
Alex Shvartzkop cc141e346d Tweak GRID_CELL_STC_EDITOR offset on GTK.
(cherry picked from commit ab531a33d9)
2024-07-21 15:18:44 +03:00
Alex Shvartzkop f5954b0d7d Fix some warnings.
(cherry picked from commit affcfed677)
2024-07-21 15:18:44 +03:00
Alex Shvartzkop 6bb1e59e10 Improve grid cell editors appearance.
(cherry picked from commit 76b7cdd128)
2024-07-21 15:18:44 +03:00
Alex Shvartzkop ced6b1cbb7 Improve custom grid cell editors' margins on MSW.
(cherry picked from commit 1516aaf163)
2024-07-21 13:44:15 +03:00
Alex Shvartzkop d1d7d0eb05 Remove macOS size tweak in custom grid cell editors.
Since the text field now has the no-border flag, it shouldn't be needed.

(cherry picked from commit aa51cc5167)
2024-07-21 13:44:15 +03:00
Alex Shvartzkop e1e196f1b1 Fix default cell alignment and FBP file for Configure Paths dialog.
(cherry picked from commit 49dcd5f4fc)
2024-07-21 13:44:15 +03:00
Alex Shvartzkop b55d760cd5 Make grid cell editors with extra button consistent with normal text cell editors.
(cherry picked from commit 5d22c1adee)
2024-07-21 13:40:21 +03:00
Alex Shvartzkop b0a0408528 Create STATUS_TEXT_POPUP on demand when moving PCB items.
So we don't have to spend 115 ms destroying it.

(cherry picked from commit 8d7c60eb3e)
2024-07-21 13:31:45 +03:00
Alex Shvartzkop d238a149a6 Send data to correct sch port when changing selection in PCB editor.
Not that cross-probing works like this though.
But this prevents the UpdateAllLayersColor call.
(-356 ms in https://gitlab.com/kicad/code/kicad/-/issues/18148)

(cherry picked from commit e2b5f4559e)
2024-07-21 13:31:03 +03:00
Alex Shvartzkop 57d2f7209a Use std::set::contains instead of alg::contains in UpdateTeardrops.
(-356 ms on https://gitlab.com/kicad/code/kicad/-/issues/18148 when placing)

(cherry picked from commit 70296107b4)
2024-07-21 13:30:39 +03:00
Alex Shvartzkop 8d08992c24 Shut down curl operations before global cleanup.
Fixes KICAD-7DP
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17103

(cherry picked from commit 0a53fc41a7)
2024-07-21 13:28:31 +03:00
Alex Shvartzkop 9938e7f723 Don't limit ngspice netlist lines to 1024 bytes.
Otherwise the loop just makes infinite 1-byte allocations
and keeps appending \n.

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

(cherry picked from commit a1b4e09cec)
2024-07-21 13:27:53 +03:00
Alex Shvartzkop 17ad578675 QA: add another test case for SHAPE_LINE_CHAIN::Slice.
This causes it to break on MSVC Release as well.

See https://gitlab.com/kicad/code/kicad/-/issues/18391

(cherry picked from commit 0e4ed5a032)
2024-07-21 13:25:57 +03:00
Alex Shvartzkop 044dd59c5c QA: add two more tests for SHAPE_LINE_CHAIN::Slice.
"Case 9: Start at middle of a 2nd arc, finish at end" should throw a fatal assert in Debug.

See https://gitlab.com/kicad/code/kicad/-/issues/18391

(cherry picked from commit 0b06ed987e)
2024-07-21 13:25:57 +03:00
Alex Shvartzkop 6ef90cfa18 Add bounds checking when slicing SHAPE_LINE_CHAIN from the middle of the last arc.
(and said arc is the last shape in the chain)

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

(cherry picked from commit 63eac0382c)
2024-07-21 13:24:17 +03:00
Jeff Young 7abf4c2d91 Save visible columns to correct settings.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18352

(cherry picked from commit 22321c93f0)
2024-07-21 11:16:57 +01:00
Jeff Young 896ff72019 Formatting.
(cherry picked from commit 8ae111bd82)
2024-07-21 11:16:57 +01:00
jean-pierre charras 9c2eeb54fc Ensure non handled text properties are never written in .kicad_pcb files
ctl_flags.h: fix two duplicate flag values.
From master branch
2024-07-21 08:46:44 +02:00
jean-pierre charras 69f583660f Move all CTL_OMIT_xxx flags definitions into a new file ctl_flags.h
Previously, they were defined in different files, and sometimes redefined.
This change should not create an actual code change.
However, this move shows there are the same value used for different flags,
so another fix should be made later.

From master branch
2024-07-21 08:46:44 +02:00
Mark Roszko 6334c733e1 Update 2 files
- /vcpkg-configuration.json
- /vcpkg.json
2024-07-21 01:19:06 +00:00
Mathieu Pilato a50144f889 Fix measurement format not saved when modified
Always update stored measurements name / format when updating measurement

(cherry picked from commit c8aa3f21aa)
2024-07-20 21:52:05 +01:00
Mathieu Pilato 1ed85d521d Move default format inside SPICE_VALUE_FORMAT
This ensures that the default format is the same, however the measurements are added

(cherry picked from commit 75141da53a)
2024-07-20 21:52:01 +01:00
Mathieu Pilato 793790b359 Fix spice errors when rerunning a simulation with measurements
Mark the simulation as not finished before starting it, preventing measurements from being requested
from spice right before simulation starts

(cherry picked from commit a5b7c65d7a)
2024-07-20 21:51:58 +01:00
Mathieu Pilato 154112d4cc Clear measurement grid while changing tab
Prevent a tab change while editing measurement from impacting measurements of target tab

(cherry picked from commit 98b4a58059)
2024-07-20 21:51:54 +01:00
Mathieu Pilato 97d8ddeb4f Fix measurements not being loaded with workbook
onPlotChanging() was overwriting loaded measurements. Do not read grid from onPlotChanging().

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

(cherry picked from commit c6e8838178)
2024-07-20 21:51:51 +01:00
Mathieu Pilato 4809b00206 Increase default measurement precision to 3 digits
(cherry picked from commit 414ac2b83c)
2024-07-20 21:51:47 +01:00
Jeff Young 5bc1040a8b Fix missing From_UTF8().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18406

(cherry picked from commit 756445dd19)
2024-07-20 21:26:52 +01:00
Jeff Young f6c8dbe81e Fix RecombinePad when pad is rotated.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18348

(cherry picked from commit 556efd836b)
2024-07-20 21:26:52 +01:00
Jeff Young 0280989920 Undo for Repeat Pin.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18261

(cherry picked from commit 0b4d0bcb6c)
2024-07-20 21:26:52 +01:00
Jeff Young 0b762fb804 Show footprint change/update immediately.
Also, don't deselect selected footprints.

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

(cherry picked from commit e450258c0f)
2024-07-20 21:26:52 +01:00
Seth Hillbrand b71eb1186f Avoid losing the last point when simplifying
line chains that are not closed should avoid simplifying between
beginning and end points.  Make sure that we keep the finishing point
for these chains

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18409
2024-07-20 13:02:01 -07:00
Seth Hillbrand c78273cb99 Avoid throwing spurious substitution warnings
If the original font is a bold singleton (not a mod on a face), then we
need to avoid the mismatch between the bold marker and the asked-for
boldness.

At the end, if the font name is the same within case differences, then
it is the same font and we should not warn

(cherry picked from commit 0f84ddaf39)
2024-07-20 11:41:44 -07:00
Seth Hillbrand 26b8978b3e Fix potentially incorrect libid when using save as
If you use save as into a different library and change the symbol name
while overwriting an existing symbol, the libid didn't get updated,
leading to an error message when trying to load the newly saved symbol.

(cherry picked from commit b38357a5ea)
2024-07-20 11:41:44 -07:00
Jon Evans 618bbfda8d Support SWIG 4.1
(cherry picked from commit 58a2159fa9)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-07-19 22:49:52 +00:00
JamesJCode ee573a1480 Remove unnecessary erase of netclasses from netclass map
We start from an empty map now, so no need to delete entries
individually

(Cherry-picked from 90304e0639)
2024-07-16 20:37:22 +01:00
JamesJCode 20efc3b6e6 Resolve netclasses on vector buses embedded in buses
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16545

(Cherry-picked from 924b027503)
2024-07-16 19:57:54 +01:00
JamesJCode 8632e74c5c Update BOARD_LISTENERs after calculating connectivity
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18277
(For v8)
2024-07-16 19:57:54 +01:00
Wayne Stambaugh 6f35fd7058 Begin version 8.0.5 development. 2024-07-16 14:42:07 -04:00
Wayne Stambaugh 761bfcd291 Tag stable version 8.0.4. 2024-07-16 14:39:53 -04:00
Seth Hillbrand 7663928a66 Update translations 2024-07-16 11:00:39 -07:00
boromyr dd3c846f4a Translated using Weblate (Italian)
Currently translated at 99.9% (9191 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-07-16 20:00:06 +02:00
CloverGit 6877bc32bc Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-16 20:00:06 +02:00
Jan Straka 64564825c7 Translated using Weblate (Czech)
Currently translated at 82.8% (7616 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-07-16 20:00:06 +02:00
CloverGit b1ec1011b6 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-16 20:00:06 +02:00
Toni Laiho 80539790c3 Translated using Weblate (Finnish)
Currently translated at 99.8% (9181 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-07-16 20:00:06 +02:00
CloverGit 981772887a Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-16 20:00:06 +02:00
dsa-t 896b80652f Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-16 20:00:06 +02:00
Wellington Terumi Uemura 968cf4267a Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-07-16 20:00:06 +02:00
jean-pierre charras f3567cda99 Pcbnew, Properties panel: mask 2 properties irrelevant for pcb fields.
Color and Hyperlink properties have no meaning for pcb fields, but if set
created unreadable .kicad_pcb files.

From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18368
2024-07-14 14:06:29 +02:00
Seth Hillbrand df372baff8 Update translations 2024-07-11 09:41:19 -07:00
dsa-t dec96e6a77 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-10 23:46:07 +02:00
alevtina-karashokova 8a1de8c6f8 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-10 23:46:07 +02:00
dsa-t 255975f5fd Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-10 23:46:07 +02:00
Toni Laiho aa608ca147 Translated using Weblate (Finnish)
Currently translated at 99.8% (9181 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-07-10 23:46:07 +02:00
Seth Hillbrand 682b74f7d2 Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-07-10 23:46:06 +02:00
JamesJCode d662b2c34b Fix tuning pattern moves and undo / redo
(Cherry-picked from 230c297691)
2024-07-09 15:23:02 +01:00
Seth Hillbrand 7740c66479 Update translations 2024-07-08 09:55:01 -07:00
Seth Hillbrand 4d4f6a810c Properly count multiple Altium version settings
There is a fair amount of gradation in different Altium products

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

(cherry picked from commit 6aaaaad37f)
2024-07-08 09:54:46 -07:00
alevtina-karashokova d74dca3a7a Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-08 18:53:38 +02:00
Wellington Terumi Uemura 6513ca9168 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-07-08 18:53:37 +02:00
aris-kimi 6782bb73bd Translated using Weblate (Greek)
Currently translated at 99.8% (9177 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/el/
2024-07-08 18:53:37 +02:00
CloverGit 9c35689b04 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-08 18:53:37 +02:00
Ulices 8aff7cad17 Translated using Weblate (Spanish (Mexico))
Currently translated at 99.5% (9154 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-07-08 18:53:37 +02:00
Henrik Kauhanen c2c6cad525 Translated using Weblate (Swedish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-07-08 18:53:37 +02:00
alevtina-karashokova 9b17ec5d2d Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-08 18:53:37 +02:00
CloverGit e971f90adc Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (9158 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-08 18:53:37 +02:00
ZbeeGin 06c61a4831 Translated using Weblate (Polish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-07-08 18:53:37 +02:00
Laurens Holst 7977f0f745 Translated using Weblate (Dutch)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-07-08 18:53:37 +02:00
Seth Hillbrand 38a2b8eba7 Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-07-08 18:53:37 +02:00
Marco Ciampa 951f0065ed Translated using Weblate (Italian)
Currently translated at 99.9% (9191 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-07-08 18:53:37 +02:00
Bahtiyar Bayram 22c06c7ed8 Translated using Weblate (Turkish)
Currently translated at 57.3% (5269 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-07-08 18:53:37 +02:00
dsa-t 4f086271aa Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-08 18:53:37 +02:00
ZbeeGin 297999cb43 Translated using Weblate (Polish)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-07-08 18:53:37 +02:00
Arnau Llovet Vidal 91aec9ac7f Translated using Weblate (Catalan)
Currently translated at 47.3% (4354 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ca/
2024-07-08 18:53:37 +02:00
jean-pierre charras 9105b380c3 Fix compil issue created by my commit b2f8a43c (Windows only) 2024-07-07 15:39:42 +02:00
jean-pierre charras a285f86240 French translation update 2024-07-07 13:23:25 +02:00
jean-pierre charras b2f8a43c24 DIALOG_USER_DEFINED_SIGNALS: workaround to solve an issue on Windows.
See: https://gitlab.com/kicad/code/kicad/-/issues/15837
This is not a fix, but a workaround to make this dialog usable on Windows.
Without this workaround, it is barely possible to edit a user signal name.
The root cause needs to be fixed.
From master branch
2024-07-07 13:22:33 +02:00
Wayne Stambaugh 8383165269 Tag stable version 8.0.4 release candidate 2. 2024-07-01 16:20:03 -04:00
Seth Hillbrand bc8af77aba Fix docs redirect for v8 2024-07-01 12:57:57 -07:00
Seth Hillbrand 7d0e1670ee Update translations 2024-07-01 10:55:23 -07:00
jean-pierre charras 877f7daa2b do not flag an empty string as translatable.
(cherry picked from commit 1c9e96c89a)
2024-07-01 10:55:09 -07:00
Seth Hillbrand 4c563e5ef3 Update translations 2024-07-01 10:53:10 -07:00
Seth Hillbrand d6d6075a60 Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-07-01 19:21:15 +02:00
Pferd O 49c528f3ef Translated using Weblate (German)
Currently translated at 99.6% (9158 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-07-01 19:21:15 +02:00
Henrik Kauhanen ae1bccfb85 Translated using Weblate (Swedish)
Currently translated at 99.9% (9191 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-07-01 19:21:15 +02:00
dsa-t c2c13a5226 Translated using Weblate (Russian)
Currently translated at 100.0% (9193 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-01 19:21:15 +02:00
Toni Laiho 5b2e0d113a Translated using Weblate (Finnish)
Currently translated at 99.8% (9177 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-07-01 19:21:15 +02:00
dsa-t 7ee8f786f2 Don't try to clear empty bitmap cache.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18310


(cherry picked from commit e5a5b59ac1)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-07-01 15:23:55 +00:00
Alex Shvartzkop bd14224b42 QA: remove 8.99 files for issue17967. 2024-07-01 14:47:38 +03:00
Seth Hillbrand ccfec170b0 Modify some int32 ops to avoid potential overflow
(cherry picked from commit f48a105357)
2024-07-01 14:30:43 +03:00
Seth Hillbrand 9852b535e7 Fix nl.po from bad merge 2024-06-30 11:16:44 -07:00
jean-pierre charras 758ac90069 SIMULATOR_FRAME_UI: catch all nlohmann::json::xxx errors.
Previously, only nlohmann::json::type_error was captured, and other errors
were not handled, creating unhandled exception issue when reading broken
*.wks files.
From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18309
2024-06-30 18:51:31 +02:00
Alex Shvartzkop 697ff382f8 Fix edit point ordering for arcs in symbol editor.
Was fixed for SCH_SHAPE in f6994702aa
but 8.0 uses LIB_SHAPE for symbols.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18307
2024-06-30 18:07:53 +03:00
jean-pierre charras 6b6aa84158 French translation update 2024-06-30 09:06:42 +02:00
Marco Ciampa a0d219c2d1 Updated Italian translation 2024-06-30 01:11:36 +02:00
Seth Hillbrand 8af1af7f76 Update translations 2024-06-29 12:41:36 -07:00
Jan Straka 991d5812e2 Translated using Weblate (Czech)
Currently translated at 82.8% (7605 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:37:14 -07:00
김랑기 b019ce4515 Translated using Weblate (Korean)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-06-29 12:37:14 -07:00
김랑기 168a1b3e75 Translated using Weblate (Korean)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-06-29 12:37:13 -07:00
김랑기 e8a6e579e4 Translated using Weblate (Korean)
Currently translated at 99.9% (9174 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-06-29 12:37:12 -07:00
aris-kimi f2b1422ed5 Translated using Weblate (Greek)
Currently translated at 99.9% (9176 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/el/
2024-06-29 12:37:00 -07:00
Jan Straka 63f4d45665 Translated using Weblate (Czech)
Currently translated at 82.1% (7543 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:36:51 -07:00
ivit VT 96ab1e47c9 Translated using Weblate (Czech)
Currently translated at 81.5% (7490 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:36:51 -07:00
ivit VT 4d69d966ee Translated using Weblate (Czech)
Currently translated at 81.4% (7481 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:36:51 -07:00
pominglee e9294bee9e Translated using Weblate (Chinese (Traditional))
Currently translated at 99.7% (9162 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-06-29 12:36:49 -07:00
CloverGit d2b052b12c Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-06-29 12:36:37 -07:00
Pferd O 34f0a97cca Translated using Weblate (German)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-06-29 12:35:33 -07:00
Laurens Holst ad5ca38cc2 Translated using Weblate (Dutch)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-06-29 12:35:06 -07:00
Nguyễn Ngọc Khánh 58bd7f3b24 Translated using Weblate (Vietnamese)
Currently translated at 21.7% (2000 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-06-29 12:34:38 -07:00
Jan Straka 5b2b4832d4 Translated using Weblate (Czech)
Currently translated at 81.1% (7452 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:34:36 -07:00
Nguyen Van Dien a3618cbfeb Translated using Weblate (Vietnamese)
Currently translated at 21.7% (1994 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-06-29 12:34:10 -07:00
Seth Hillbrand 8c6edc0414 Fix via layer test for DXF plotting
Vias might have their primary layer set to a single layer but cross
multiple layers that should be included when plotting

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

(cherry picked from commit 64c36e8bda)
2024-06-29 12:25:15 -07:00
Seth Hillbrand 1308fd7c4a Altium import
- Handle intermediate Altium version with some fields but not others
- Ensure that we are properly moving text that is not a box and not a
  field

(cherry picked from commit 9aba808366)
2024-06-29 12:19:25 -07:00
Seth Hillbrand b241e09914 Don't knock out anti-text box
Knockout text should only prevent filling directly around the text
itself, not the larger anti-text fill around it.  This prevents minimum
width provisions from kicking in unneccesarily

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

(cherry picked from commit a12bc3a410)
2024-06-29 12:18:54 -07:00
Seth Hillbrand 0a29c0dea3 Fixup Altium import rectangle handling
Ensure we have positive sizes
Keep rectangles when rotating by multiples of 90

(cherry picked from commit d033f93d89)
2024-06-29 12:17:53 -07:00
Seth Hillbrand 8832b22952 Fixup for Altium pad/fill importer
The previous commit merged pads with copper areas.  This was appealing
but broke when the pad and the area were meant to have different
size/shape technical layers.  Small pads = Small paste.  Instead, we do
not merge the pads but we assign them to have the appropriate nets in
KiCad, allowing the same effective result but keeping the technical
layers correct

(cherry picked from commit 51eb7aa5b5)
2024-06-29 12:17:53 -07:00
Seth Hillbrand 33b93a3824 Altium import: handle polygons on copper
In Altium, copper polys will be connected automatically to their
associated pads.  In KiCad, we need to do the equivalent when parsing,
which is to combine the joining copper into the underlying pad.  We also
don't want to treat copper polys as proxy pads without the original
anymore.

(cherry picked from commit 7102d9f72a)
2024-06-29 12:17:53 -07:00
Seth Hillbrand b589da63d8 Cleanup Altium text import
Handle inverted text
Correct location for flags
Add mechanics to detect inverted_rect (like text boxes)

(cherry picked from commit b11e030f8f)
2024-06-29 12:17:53 -07:00
Seth Hillbrand 48077d77c4 Altium: Handle textboxes
Also, corrects a minor issue with the text width calculation where
Altium calculates centerline to centerline but KiCad text heights are to
the edge of the stroke font.  Need to still do better adjustments for
the various altium stroke fonts

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

(cherry picked from commit 7e561acf53)
2024-06-29 12:17:53 -07:00
Alex Shvartzkop a605c4b6ff Disable hidpi cursors on GTK and OSX.
wxCursor scale factors won't be supported before wx 3.3.
MSW doesn't scale cursors, so it works as expected there.

(cherry picked from commit e3e63fb1b8)
2024-06-29 21:43:47 +03:00
Seth Hillbrand 092ce30b40 Altium: Handle footprint vias
These are treated as pads in KiCad

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

(cherry picked from commit 7ea013b96c)
2024-06-29 11:38:36 -07:00
Seth Hillbrand 28eb6dab97 Handle hierarchical sheets in incremental change
The drivers need to get passed up and down the hierarchical sheets.  In
order to do this, both the sheet pin and the hierarchical pin need to
be in the changed items.  However, we only get sheets in the screen
items list while the pins are the elements that get set dirty

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

(cherry picked from commit 5f16c5892c)
2024-06-29 11:26:03 -07:00
Seth Hillbrand fb82130530 Fixup cherry-picks for v8 2024-06-29 11:22:11 -07:00
Seth Hillbrand a3d218ffbc Fixup arc check in dp coupled
Handle arcs starting at candidate end point.
Fix total arc size

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

(cherry picked from commit 015b93b474)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 471f72a340 Handle arcs dp coupling
Calculate coupled arcs and spacing

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

(cherry picked from commit 75ab3d9e8b)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 2abbc601a0 Detect if HiDPI cursors are needed
HiDPI cursors are twice as large as regular cursors, allowing them to be
more easily seen on a HiDPI system

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

(cherry picked from commit ab0426d620)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 522f1c7bea Ensure nets are referenced to main board
We set new elements to the temporary board's netlist.  These need to be
updated when moving the fooprint to the main board

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

(cherry picked from commit 54efd32f7a)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 828f32649f Hookup footprint reload to redraw icon
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7195

(cherry picked from commit 6537f9fa15)
2024-06-29 11:22:11 -07:00
Seth Hillbrand b39b54a92e Fallback to scientific notation when fixed-point is long
Fixed point output can create arbitrarily long string representations of
floating points.  When this happens, we would like to just represent the
scientific notation to a limited precision

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

(cherry picked from commit 24f02e72d0)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 6a55a47276 Subtract all holes in board area calc
When we say "Subtract holes from board area", we should also subtract
those holes in pads and vias

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

(cherry picked from commit 91f6c534b9)
2024-06-29 11:22:11 -07:00
Wayne Stambaugh 648d463b32 Tag stable version 8.0.4 release candidate 1. 2024-06-29 11:58:56 -04:00
Seth Hillbrand 489f345fb2 ADDED: Handle PIECHART in Altium import
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16895

(cherry picked from commit 5bd94f118d)
2024-06-29 08:05:04 -07:00
Seth Hillbrand e308d65108 Ignore hidden text fields when cross-probing
Zoom-to-selection should only show the elements that we can see, so
avoiding hidden fields in footprints keeps the zoom window appropriately
sized

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

(cherry picked from commit 416033e8e5)
2024-06-29 08:02:57 -07:00
Seth Hillbrand ee0be76fb4 Don't list IPC-2581 import
We don't currently support importing 2581 files.  We need to clear
IO_FILE_DESC to prevent this from accidentally showing

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

(cherry picked from commit eeee63186d)
2024-06-29 08:02:27 -07:00
Seth Hillbrand 813fce2d2d Fully expand all text variables in 3d output
We were doing half of the job but we need to get the board variables as
well

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

(cherry picked from commit 79166510e9)
2024-06-29 08:01:33 -07:00
Frank Muenstermann e0a27b430a kicad-cli: The --precision parameter was not recognized, if unit was inch, the export crashed
(Cherry-picked from 63d828d5ff)
2024-06-29 03:43:06 +01:00
Ian McInerney 73b2180c06 Take footprint edge cuts into account in the board statistics
Reported in https://gitlab.com/kicad/code/kicad/-/issues/18245

(Cherry-picked from 10988478da)
2024-06-29 03:27:42 +01:00
Ian McInerney b3f53ac862 Always include footprint edgecuts in board edge bounding box
The footprint edgecuts should always be part of the board edge bounding
box, even if the layer the footprint is on is hidden from view.

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

(Cherry-picked from 672d2c6af8)
2024-06-29 03:27:14 +01:00
Ian McInerney 9b49fc5a0d Display unit name in symbol context menu
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18285

(Cherry-picked from cc81ccf79a)
2024-06-29 02:16:26 +01:00
Jeff Young 03c71b22d5 Improve consistency of clearance line painting.
Showing the clearance area is not obvious as the clearance
extends from the pad on flashed copper layers and from the
hole on non-flashed copper layers.  Because of this, we
choose to not display clearance lines at all on non-copper
active layers as it's not clear which we'd be displaying.

We follow the same rule for tracks for consistency (even
though they don't have the same issue).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18287
2024-06-28 21:46:49 +01:00
Jeff Young 7d79bebcc6 Don't overload error dialog.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18195

(cherry picked from commit 441da8dfb6)
2024-06-28 20:59:29 +01:00
Jeff Young 5c2300022b Don't flip alignment of non-side-specific text.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18235

(cherry picked from commit 0040c290ed)
2024-06-28 20:58:47 +01:00
jean-pierre charras 91b042990f footprint selector in symbol properties: fix footprint selection issue.
When using the button to select a footprint using the footprint chooser
dialog, the new footprint was not always taken in account (perhaps MSW specific).
It was due to the code to update the footprint name was between Disable() and
Enable, thus creating a loss of some events in the complex grid edition stuff.
This is now replaced by a lock flag to protect this code to be executed when
it should not.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18270
2024-06-27 20:07:38 +02:00
Jeff Young 265e2d61be Clear timestamp when clearing cache.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17913

(cherry picked from commit 5a9b681009)
2024-06-25 13:56:33 +01:00
Jeff Young df3924421d enclosedByArea test for zone needs to be outline-based.
(Otherwise it's order-specific when filling, which
is pretty unpredictable.)

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

(cherry picked from commit 5ba2896968)
2024-06-25 13:55:51 +01:00
Jeff Young 4ee2a007eb Hidden footprint libraries are not yet supported.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18183

(cherry picked from commit b7161181e8)
2024-06-25 13:54:56 +01:00
Jeff Young b19a47fa2a Performance for large hierarchies: ERC
Share constructs between ERC tests.

Large SCH_SHEET_LISTs, in particular, can be very
expensive to construct.

(cherry picked from commit 68fbe98b1d)
2024-06-25 13:34:49 +01:00
jean-pierre charras 7f3ca3b889 Gerber plots: Ensure reserved chars are not used in Gerber field strings.
In gerber fields, reserved chars (,*%) must be replaced, because they are separators.
From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18275
2024-06-25 11:26:03 +02:00
Seth Hillbrand a3d64d604c Silence font replace warnings for libs
When loading schematics/pcbs, notification of font replacements might be
warranted but in libraries, this warning is not helpful and intrusive

(cherry picked from commit 11c6164934)
2024-06-24 12:01:30 -07:00
Alex Shvartzkop 006f0a95c1 Optimize testCourtyardClearances when moving footprints (33%->0.69%)
Check bounding boxes without hidden text first before trying to check courtyards.

See https://gitlab.com/kicad/code/kicad/-/issues/18148

(cherry picked from commit 4bf8ed32cd)
2024-06-24 06:44:28 +03:00
Alex Shvartzkop 6afd865259 Optimize testCourtyardClearances when moving a board.
CPU usage: 86% -> 33%

See https://gitlab.com/kicad/code/kicad/-/issues/18148

(cherry picked from commit dc56364cf2)
2024-06-24 02:03:33 +03:00
Alex Shvartzkop d319cd4b89 Improve error message when trying to Open non-KiCad schematic files.
See https://gitlab.com/kicad/code/kicad/-/issues/18241
2024-06-22 20:35:23 +03:00
Wayne Stambaugh 566fefafc5 Fix Eagle schematic importer incorrect symbol value field and visibility.
Also fix a crash if an XML_PARSER_ERROR exception is thrown when importing
Eagle symbol libraries.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18232
2024-06-22 12:22:03 -04:00
Seth Hillbrand 66bd0f850a Allow NIC pins to be stacked
Previously, we only allowed pins of the same time as well as passive
pins to be stacked.  This change allows NIC pins as well since they are
not internally connected, there is no reason that they cannot be tied to
another pin electrically

(cherry picked from commit 0e0ada8e4e)
2024-06-22 08:12:51 -07:00
Alex Shvartzkop 491bb6e57a Altium schematic import: fix power port styles.
Need to use the symbol name with style, like "VCC_CIRCLE", not "VCC".

Issue was introduced in d939004bbd

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18209
2024-06-22 06:58:41 +03:00
dsa-t 4fe74a9870 Fix arc edit points ordering in schematic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18254


(cherry picked from commit f6994702aa)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-06-22 03:20:02 +00:00
Seth Hillbrand 8f03f7c367 Allow non-identical schematic/pcb nets
The schematic net names are fully unique but if we have multiple pads
that are mapped to a NC pin, they need to have unique net names so that
they do not get connected to each other in the ratsnest.  This breaks
the schematic parity check as we have modified the netname for some
pads.  To work around this, we first maintain the zero-th net without
suffix and then add an additional check in DRC to ensure that we allow
unconnected nets as long as the share a common prefix with the schematic
netname.

(cherry picked from commit f61d400d88)
2024-06-21 12:26:23 -07:00
Seth Hillbrand 7f690d596b Resolve worksheet variables in SCH_FIELD
Sheet fields should also resolve the worksheet of that sheet and not the
parent sheet

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

(cherry picked from commit 6540c3ec9f)
2024-06-21 10:31:11 -07:00
Mark Roszko be4c2715ab Don't use message as part of the assert dedup
kimath overflow can generate thousands of unique messages in one run lolol


(cherry picked from commit acec5552c0)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-06-21 11:20:17 +00:00
Seth Hillbrand 02f8260e18 Clean git conflict markers 2024-06-20 09:25:04 -07:00
Seth Hillbrand a8871fdda4 Fix cherry-pick for v8 2024-06-20 09:13:12 -07:00
Alex Shvartzkop d552ce00aa Optimize redrawNetnames.
Using RTree is slower in this case.

RTree: 25 ms when moving cursor
This method: 5 ms when panning/zooming

(cherry picked from commit 62fb5697b4)
2024-06-20 18:49:32 +03:00
Alex Shvartzkop 37dd7c6df9 Backport BOX2I_MINMAX. 2024-06-20 18:49:32 +03:00
Alex Shvartzkop a5cbcd4abe Don't call GetSide in FOOTPRINT::GetBoundingBox when not needed.
CPU usage: -13% when moving a board.

(cherry picked from commit f5be388acd)
2024-06-20 18:49:32 +03:00
Alex Shvartzkop 4ede6f61b2 Fix build errors introduced in 994c1c971a 2024-06-20 18:37:39 +03:00
Seth Hillbrand 994c1c971a Respect schematic settings for hidden pins
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17941

(cherry picked from commit b8ccaae403)
2024-06-19 18:07:52 -07:00
Alex Shvartzkop ebdfeb4c0a Fix crash in wxSocketBase when the event handler has been destroyed.
Fixes KICAD-37B
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18234
2024-06-19 00:49:53 +03:00
Jon Evans e1ffd956e6 Try harder to keep searchable text hidden in SVG exports 2024-06-18 11:59:46 -04:00
Jeff Young 3f4dc01d97 Don't report reasonable solder mask bridges in a net-tie footprint.
(cherry picked from commit eae85742cc)
2024-06-15 16:56:12 +01:00
Jeff Young be192d5df0 Check mask apertures on the mask layer.
(Otherwise testing A:B and B:A will add items to the
m_maskApertureNetMap cache on different layers.)

(cherry picked from commit 8cddd40fc9)
2024-06-15 16:47:41 +01:00
Jeff Young efc35dec74 Footprint Editor doesn't have nets.
(Copper shapes, on the other hand, can.  Since we use
GetItemDescription() to report DRC errors and the like,
it's better to have it report the net even when it's
<no net>.)

(cherry picked from commit b2588e0bbf)
2024-06-15 16:47:35 +01:00
jean-pierre charras 096566e857 Schematic editor: fix some issues that can crash the editor on closing.
- Add a test to be sure a SCHEMATIC exists before trying to use it
- Delete items in Repeat list and undo/redo list before deleting the schematic
- Delete also these items when loading a new schematic (the repeat list was
not cleaned previously)
( include qa compatibility from master )
Before these fixes I saw a use after delete issue due to dangling pointers
stored in Repeat list.
From master branch
2024-06-15 09:22:02 +02:00
Jeff Young 944ee4af7d Normalize phase angles. 2024-06-14 19:01:37 +01:00
Jeff Young 245894e8eb Pull netname bug fixes and performance improvements back from master. 2024-06-14 19:01:37 +01:00
Jeff Young 74abb40e84 Don't lose value of cursor checkboxes when running sim.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit c633ac26eb)
2024-06-14 19:01:37 +01:00
Jeff Young 1eb2983efe Don't assume AC gains will always be voltages.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit 4eb048bba2)
2024-06-14 19:01:37 +01:00
Jeff Young 63b3e0cc4f Correctly write phase/gain signals to workbook.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit 300313ce73)
2024-06-14 19:01:37 +01:00
Jeff Young a8b127019c Don't use SI prefixes with degrees when auto-ranging.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit 5a3bad51d0)
2024-06-14 19:01:37 +01:00
Jeff Young 4d0ca33b47 Current gain is the first Y axis, not the second.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit 7b63429fe1)
2024-06-14 19:01:37 +01:00
JamesJCode e2c53df13b Fix shadowed variable warning 2024-06-12 08:13:40 +01:00
Wayne Stambaugh 03dd6c7a8e Clear parent symbol references when flattening derived library symbols.
Broken parent symbols could lead to invalid return values and flattened
library symbols cannot be derived from a parent symbol.

(cherry picked from commit 360d185e3b)
2024-06-10 16:14:54 -04:00
JamesJCode bdd5a752dc Don't re-add deleted netclass assignments in incremental connectivity
Ensures that if moving or deleting a netclass directive label, the
netclass on the previously-assigned net doesn't have the stale
netclass re-applied.

Cherry-picked from 0826c10a20

(Along with prior connectivity cherry-pick...)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18173
2024-06-10 20:40:20 +01:00
JamesJCode 8dbdc3717c Eeschema: Only assign nets with resolved netclasses to the label map
Also fixes a bug where the pattern assignment cache was not cleared
if all pattern assignments were deleted in the setup netclasses
panel.

Cherry-picked from 9e1a5eb1bd
2024-06-10 20:31:35 +01:00
Alex Shvartzkop f60b76696a Cairo GAL: improve alignment between arcs and segments and of odd-width lines. 2024-06-10 21:21:13 +03:00
dsa-t 695505fc71 Fix build error caused by commit 82c2bda52b.
(cherry picked from commit 012d3f098f)

Co-authored-by: Wayne Stambaugh <stambaughw@gmail.com>
2024-06-10 15:02:21 +00:00
Alex Shvartzkop b34dbf58c5 Altium PCB import: don't add thickness to Solid style fills. 2024-06-10 17:32:52 +03:00
Alex Shvartzkop 1fb19c0d81 Altium PCB import: make sure Polygon fill is contained within the outline. 2024-06-10 17:19:43 +03:00
Jeff Young d6162196ec Fix KeepUpright settings in Eagle gold files.
(cherry picked from commit aa1fb0604a)
2024-06-09 23:47:00 +01:00
Alex Shvartzkop 3ea314cb9f Altium PCB import: avoid integer overflows when rotating rectangular fills.
Fixes artifacts seen in https://gitlab.com/kicad/code/kicad/-/issues/18156
2024-06-10 01:00:57 +03:00
Jeff Young 9d51fabe9b Don't default KeepUpright to true in Eagle importer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18175
2024-06-09 22:17:39 +01:00
Alex Shvartzkop c6b483acb9 QA: update golden data for Altium "Tracks" PcbLib. 2024-06-09 23:01:26 +03:00
Alex Shvartzkop 96370f6665 Make sure to add start points to arcs in TransformOvalToPolygon.
Otherwise the long line segments can be non-parallel to the centerline.

This was the root cause of the slowdown in https://gitlab.com/kicad/code/kicad/-/issues/18156

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

(cherry picked from commit 76b2741a92)
2024-06-09 22:49:58 +03:00
Alex Shvartzkop ad7bd9b5f8 Revert "Pcbnew, Altium import: Fix issues with hatched zones."
This removed the hatch fill import functionality,
and is no longer needed now that the root cause was found.

This reverts commit 616510aca2.

(cherry picked from commit 80b7f5fcbf)
2024-06-09 22:49:58 +03:00
jean-pierre charras 2a1ef2d09d Pcbnew, Altium import: Fix issues with hatched zones.
- Filled zones using the hatch pattern cannot use the primitives from Altium.
the filled shapes must be rebuilt.
_ Filled zones using the hatch pattern with a very small gap are now converted
to a polygon pattern. Otherwise the calculation time can be very big.

From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18156
2024-06-09 15:56:57 +02:00
Seth Hillbrand 9f9fa0dd8d Avoid referencing parents after deletion
We look at the parent when deleting EDA_ITEMs but when clearing the test
sheet, we delete the sheet before the pin, causing a use-after-free.
Avoid this by setting parents to null in this case

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

(cherry picked from commit b2e0c2606f)
2024-06-09 13:27:34 +01:00
Seth Hillbrand 6ecfa65c4c Free item memory when closing schematic window
This fires the dtor for each item on the screen, allowing us to properly
close and remove them from the connection graph

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

(cherry picked from commit 9fbda137cb)
2024-06-08 22:16:41 +01:00
Petri Hodju 831d438852 remove item from schematic's connection graph on destruction
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17961

(cherry picked from commit 4920c6b00b)
2024-06-08 22:14:39 +01:00
Jeff Young a9b5b1728a Don't generate thermal reliefs for pads that don't intersect zone.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18174
2024-06-07 23:06:19 +01:00
Jeff Young d304a30155 Performance for large hierarchies: sorting
Cache page numbers during sort.
Don't construct SCH_SHEET_PATH when reference will do.
Don't construct SCH_SHEET_PATH when KIID_PATH will do.

(cherry picked from commit 758974f5aa)
2024-06-07 18:03:45 +01:00
Jeff Young 02ca96df48 No need to mapCoords when everything is in same coord system.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18172
2024-06-07 18:00:41 +01:00
Jeff Young 5ca3414707 Performance for large hierarchies: lookups
Don't bother to sort sheet lists when we're just looking
up a UUID, sheet count, other symbol units, etc.

(cherry picked from commit e543ff0578)
2024-06-07 18:00:41 +01:00
Seth Hillbrand 76a68b1f8d Add missing IsMandatory() fn 2024-06-07 09:58:54 -07:00
Seth Hillbrand 41ebd3c560 Do not allow trailing/leading whitespace in mandatory fields
Reference, Value, Footprint and Datasheet all reference elements that
should not use trailing/leading whitespace or similar hidden charaters.
Other fields may utilize leading/trailing whitespace for obscure
purposes but won't break functionality as they are display only

(cherry picked from commit 6dcb9bb664)
2024-06-07 08:13:34 -07:00
Mark Roszko fbc75656f4 Move vcpkg to wx 3.2.5
(cherry picked from commit ba65231f6b)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-06-07 00:34:00 +00:00
JamesJCode b882defb28 Update connectivity for SCH_LABELs if netclass field changed
Required for https://gitlab.com/kicad/code/kicad/-/issues/17797 fix
in 8.0. This was fixed in the rule area work in 8.99 but not
cherry-picked as it was wrapped up in the wider changes / bugfixes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17797
2024-06-06 08:16:15 +01:00
Seth Hillbrand 7d7decafd4 Handle hierarchical sheets in incremental change
The drivers need to get passed up and down the hierarchical sheets.  In
order to do this, both the sheet pin and the hierarchical pin need to
be in the changed items.  However, we only get sheets in the screen
items list while the pins are the elements that get set dirty

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

Cherry-picked from 5f16c5892c
2024-06-06 07:59:30 +01:00
Mike Williams 8705bea9ab Symbol Fields Table: better handle variable fields with attributes
Attributes need to be checked first since we do some internally hackery
to make the checkboxes work.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18005
2024-06-05 13:02:40 -04:00
Jon Evans 64da49f22e Remove extraneous cache fill per row
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18159
2024-06-05 12:08:08 -04:00
Jeff Young 0c9554a325 Hand cherry-pick fixes for #18042. 2024-06-05 13:00:36 +01:00
Jeff Young dc24d13fef Import child sheets relative to project, not parent.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17785

(cherry picked from commit 8e855156c8)
2024-06-05 12:03:39 +01:00
Jeff Young 78cbb8e994 PCB_GENERATOR_Ts are PCB_GROUP_Ts too.
Also, an item must already be in a commit to add it to a group.

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

(cherry picked from commit 9fb07d886e)
2024-06-05 12:03:39 +01:00
Sven Pauli ddd0ccbefd Implemented flip for tuning patterns.
(cherry picked from commit c7ad5efbed)
2024-06-05 12:03:39 +01:00
Marco Ciampa f5797d367f Updated Italian translation 2024-06-05 12:09:49 +02:00
JamesJCode 89dff6411b Clear all dirty connectivity flags on symbols
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17984

When moving / deleting a power symbol, in some instances the
symbol is marked dirty, and sometimes the pin (depending on
whether the symbol is the primary edited item, or whether
the pin is identified through an edited item subgraph). If
the pin and the symbol are marked dirty, the pin dirty flag
was not being cleared.

Additionally, not all extracted items were being deleted
from subgraphs correctly.

Both resulted in dirty state and duplicated items in the
subgraphs during incremental connectivity, which resulted
in essentially corrupted subgraph states.
2024-06-04 21:01:50 +01:00
jean-pierre charras 093da7f73a Pcbnew, plot drill marks: fix incorrect plot drill mark in some cases.
If a non copper layers is added to a copper layer for plot with drill marks,
the drill mark was not visible (covered by shapes plotted from non copper layer).

Now copper layers are plotted after the non copper layers.
2024-06-04 18:28:15 +02:00
Mike Williams 2215e8906f SCH_REFERENCE: drop separate pointer to LIB_SYMBOL
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18115
2024-06-04 12:10:46 +00:00
Alex Shvartzkop d34df3e951 Don't construct an arc if we won't need it in pcbnew gfx importer. 2024-06-04 07:19:00 +03:00
Alex Shvartzkop 044a2305e3 Fix ellipse angles when importing DXF.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18121
2024-06-04 07:16:42 +03:00
Jeff Young 05264424b3 Improve hole-to-hole error message. 2024-06-03 21:55:36 +01:00
jean-pierre charras 3e59c40283 symbol editor: allows rotation of fields in derived symbols.
Fields in derived symbols are editable, so the context menu must allow rotations.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18003
2024-06-03 20:35:36 +02:00
Jeff Young 2a99464fc1 Don't attempt to plot rule areas.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18133

(cherry picked from commit dc8fd0996d)
2024-06-03 18:50:37 +01:00
Jeff Young 412da66cf6 Make sure ERC pin-to-pin checks are always in same order.
Comparing U1.pin1 : U2.pin1 will return the same
results as U2.pin1 : U1.pin1, but will result in a
different serialization of any exclusions.

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

(cherry picked from commit 11193d2cda)
2024-06-03 18:49:39 +01:00
Jeff Young c6215b08ed Use wxWidgets to track DPI.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17981

(cherry picked from commit 931de12072)
2024-06-03 18:47:43 +01:00
Jeff Young 769060c584 Setup 3D canvas for Footprint Chooser previews.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17910

(cherry picked from commit 3be6d5c5de)
2024-06-03 18:43:36 +01:00
Jeff Young 0b48a66cb0 Don't add things to the selection that aren't in the commit.
Don't process line-pairs when one has already been deleted.

Clean up created line segments when operation is cancelled.

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

(cherry picked from commit 6f0a1ade01)
2024-06-03 18:43:07 +01:00
Jeff Young 836b3219c1 Apply ExportPdf fix to remaining jobs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17863

(cherry picked from commit c0635f222d)
2024-06-03 18:36:46 +01:00
Jeff Young 2c0010fbcb Make sure var overrides get synced to board properties.
Also allow the board properties to override title-block properties.

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

(cherry picked from commit 3cf424d929)
2024-06-03 18:36:06 +01:00
Jeff Young c1ed2506f9 Sorting is not implemented on LIB_TREE columns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18101

(cherry picked from commit c828deee35)
2024-06-03 18:31:34 +01:00
Jeff Young 299495a0aa Repair merge errors. 2024-06-03 18:29:37 +01:00
Jeff Young 6f3b6e3ad8 Move pad checking to Footprint Checker.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18102

(cherry picked from commit 15d4e114e0)
2024-06-03 18:29:37 +01:00
jean-pierre charras cb9d78b46c FOOTPRINT::CheckPads(): better check for hole in PHT pad.
Hole not fully inside the pad copper area is now tested.

(cherry picked from commit 8165ec66e9)
2024-06-03 18:29:37 +01:00
Jeff Young 46b3dcba4f Trim punctuation from end of URLs.
(cherry picked from commit 513e68a04a)
2024-06-03 18:29:37 +01:00
Jeff Young 06150388d8 Trim trailing punctionation from doc URLs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18089

(cherry picked from commit f3b57c20af)
2024-06-03 18:29:37 +01:00
Jeff Young b07de4f6af Trim covered region to bounding hull.
Otherwise a long track crossing a footprint will look
like it covers most of it.

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

(cherry picked from commit e400d49af6)
2024-06-03 18:29:37 +01:00
Jeff Young 6dd5422137 CmpNoCase() returns 0 for a match (which evals to false as a bool).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18087

(cherry picked from commit 26fe4c05e1)
2024-06-03 18:29:37 +01:00
Jeff Young 546ca18662 Delete tuning patterns in Unroute Selected.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18065

(cherry picked from commit a678d0d710)
2024-06-03 18:29:37 +01:00
Jeff Young de0f6ecf68 Fetch board finish before exporting stackup to clipboard.
Also fixes some backward logic in setting modified flag.

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

(cherry picked from commit 032b5a6d65)
2024-06-03 18:29:37 +01:00
Jeff Young 995c1a179e Honour shift-key for spin buttons in 3D preview.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17541

(cherry picked from commit f7c7791b6c)
2024-06-03 18:29:37 +01:00
Jeff Young bee4856a7f Process clearance rules for plated holes in router.
Also makes sure the clearance is shown for a collision,
even if the preference for showing clearances is off.

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

(cherry picked from commit d5c3a4036c)
2024-06-03 18:29:37 +01:00
Jeff Young 9721559005 Push multi-sweep traces down into MathPlot.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17215

(cherry picked from commit edae328ca6)
2024-06-03 18:29:37 +01:00
Jeff Young 7a1ab44207 Rewrite Eagle rotated text algorithm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18019

(cherry picked from commit debc94ff49)
2024-06-03 18:29:37 +01:00
Jeff Young d269513857 Improve Eagle rotated text importing.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18019

(cherry picked from commit f4f3f52fd4)
2024-06-03 18:29:37 +01:00
Jeff Young b4928f20a6 We can only knockout a pad if we're plotting the pad shape.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17166

(cherry picked from commit 0ff59bc60e)
2024-06-03 18:29:37 +01:00
Jeff Young 05d2893ac1 Don't suppress hole plotting for utility layers.
Also simplifies the handling of DXF outline plotting.

Also removes some comments which were no longer accurate.

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

(cherry picked from commit 826b72c499)
2024-06-03 18:29:37 +01:00
Mike Williams 7ea205222d pcb: grab unconnected needs to ignore same-footprint ratsnets items 2024-06-03 12:46:13 -04:00
Wayne Stambaugh e853b593b1 Begin version 8.0.4 development. 2024-06-03 07:40:36 -04:00
Wayne Stambaugh c2a41bad09 Tag stable version 8.0.3. 2024-06-03 07:37:50 -04:00
charrasjp 1a13bed1c1 French translation update 2024-06-02 17:32:18 +02:00
Seth Hillbrand 7b9c775cbd Update translations 2024-05-31 17:41:24 -07:00
Mark Hämmerling e9bf1daa5f Translated using Weblate (German)
Currently translated at 99.8% (9169 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-06-01 02:40:50 +02:00
Nguyễn Ngọc Khánh d6727934a5 Translated using Weblate (Vietnamese)
Currently translated at 21.6% (1987 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-06-01 02:40:50 +02:00
Wellington Terumi Uemura a8df90762d Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-06-01 02:40:50 +02:00
Nguyễn Ngọc Khánh 7b4bb28307 Translated using Weblate (Vietnamese)
Currently translated at 21.4% (1972 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-06-01 02:40:50 +02:00
CloverGit ee8744770f Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9182 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-06-01 02:40:50 +02:00
Henrik Kauhanen ace480d3f6 Translated using Weblate (Swedish)
Currently translated at 99.9% (9181 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-06-01 02:40:50 +02:00
Henrik Kauhanen 154795d32a Translated using Weblate (Finnish)
Currently translated at 99.9% (9180 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-06-01 02:40:50 +02:00
Henrik Kauhanen ce20c6ec77 Translated using Weblate (Swedish)
Currently translated at 99.9% (9180 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-06-01 02:40:50 +02:00
dsa-t 6380f29214 Translated using Weblate (Russian)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-06-01 02:40:50 +02:00
Jan Straka 1aaf767c5d Translated using Weblate (Czech)
Currently translated at 81.0% (7441 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-01 02:40:50 +02:00
Henrik Kauhanen bd4ffa493f Translated using Weblate (Swedish)
Currently translated at 99.9% (9178 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-06-01 02:40:50 +02:00
Wellington Terumi Uemura cf26b12478 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-06-01 02:40:49 +02:00
ZbeeGin cdb26a9c97 Translated using Weblate (Polish)
Currently translated at 99.9% (9181 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-06-01 02:40:49 +02:00
Laurens Holst b5687b87bd Translated using Weblate (Dutch)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-06-01 02:40:49 +02:00
Henrik Kauhanen e581ba4c7b Translated using Weblate (Swedish)
Currently translated at 99.9% (9177 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-06-01 02:40:49 +02:00
Toni Laiho a2064f85b1 Translated using Weblate (Finnish)
Currently translated at 99.9% (9180 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-06-01 02:40:49 +02:00
Pferd O 2dbe4485cc Translated using Weblate (German)
Currently translated at 99.8% (9167 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-06-01 02:40:49 +02:00
Mark Roszko 6b7b6fa3e3 Revert "Don't reset the view controls state just because we are setting the already active tool state again"
This reverts commit e914c0c1a0
2024-05-30 12:30:40 +00:00
Wayne Stambaugh be71f776ce Tag stable version 8.0.3 release candidate 1. 2024-05-25 07:26:08 -04:00
Mark Roszko 51ba4763f0 Don't let CaptureCursor fight modal dialog
(cherry picked from commit e9fde0051f)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-25 01:17:17 +00:00
Alex Shvartzkop f9a9db6503 Fix very tall Plot dialog on GTK.
Some scrollable controls need wxFIXED_MINSIZE, on some platforms, apparently.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16926
2024-05-24 23:35:21 +03:00
Alex Shvartzkop 8d001a8031 Switch length tuner settings action scope to global to make the hotkey work. 2024-05-24 17:46:15 +03:00
jean-pierre charras 88115e1dd2 Gerbview: fix a minor issue.
When the option "always hide all layers but active" is set, the active layer
changed using hotkeys or Toolbar layer selector did not update the visible
selection.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18059
2024-05-24 08:29:49 +02:00
Mark Roszko e914c0c1a0 Don't reset the view controls state just because we are setting the already active tool state again
(cherry picked from commit 132ecee665)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-24 02:49:27 +00:00
Jon Evans a1cd73e730 Fix bad clearance logic in cecc1a2f 2024-05-23 11:21:18 -04:00
Jon Evans cecc1a2ff1 Use true arc collision for segment<>arc
Using an approximation here results in different collision
results for segment<>arc than point<>arc, which
can cause odd behavior in the router.


(cherry picked from commit 5b3b0ff836)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-23 12:58:01 +00:00
John Beard dc08cf3252 Eeschema: Also make 'note' backgrounds translucent on selection
For the same reason as device backgrounds - it obscures everything
else while moving a filled shape.

(cherry pick of commit 0bcd5e5795)
2024-05-23 16:52:30 +08:00
John Beard e20a11cbb3 Eeschema: Fix selection of items inside filled shapes
The selection heuristic broke down when one item was a filled
shape. Because all hit tests would succeed with distance 0 for
these shapes, they would always be considered the closest item
to the exclusion of all else, which made it very hard to
click on a graphic inside a filled shape.

Now, recognise when an item would be "dominating" and
decline to promote it to the "closet" spot. It will still
be selectable if there are no other items nearby, or if
there are multiple shapes.

(cherry picked from commit fd4c15517f)
2024-05-23 15:41:28 +08:00
Seth Hillbrand c27ca33a2e Ensure that the copper conn check re-adds epsilon
When checking if the particular rule is what is being checked, we rely
on the value of the minimum width.  Since we modified that to allow
width checking, this re-adds it for the comparison

(cherry picked from commit f74d1060d4)
2024-05-22 16:31:52 -07:00
Seth Hillbrand 1073ca0760 Include DRC Epsilon in connection width checker
Avoids rounding errors flagging connections too small by nanometers

(cherry picked from commit bce560d05f)
2024-05-22 16:31:52 -07:00
Jeff Young 4440fe0935 Fix keep-upright algo for footprint text.
Also removes PCB_FIELDs from rotation centre calc in
footprint editor if there is other stuff selected.

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

(cherry picked from commit 25bb3f77fa)
2024-05-22 14:47:26 -07:00
Seth Hillbrand d1cd859765 Re-enable moving of all footprint text in board
Seems like a lot of people really like to be able to modify the text
positions/content of their footprints

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

(cherry picked from commit 47e4ebb32a)
2024-05-22 10:36:42 -07:00
John Beard 36119b869c Pcbnew: Fix context menu when moving
The EDIT_TOOL is actually 'co-operating' with the SELECTION_TOOL
by putting its tools into the SELECTION_TOOL's menu. This means
the EDIT_TOOL::m_menu is sad and empty inside, and if you show it,
it either doesn't show at all, or a tiny stub is shown.

(cherry picked from commit af74d2a746)
2024-05-22 11:24:47 +08:00
Roberto Fernandez Bautista 3e5ceaa319 kicad-cli sym export svg: Ensure bounding box is correctly calculated
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18062
2024-05-21 21:59:38 +02:00
Seth Hillbrand 78cd01038f Update translations 2024-05-21 09:38:08 -07:00
Ivan Chuba 7b4952df11 Translated using Weblate (Ukrainian)
Currently translated at 87.5% (8031 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/uk/
2024-05-21 18:35:36 +02:00
CloverGit 73acc80c1d Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9171 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-05-21 18:35:36 +02:00
pominglee 8b41207351 Translated using Weblate (Chinese (Traditional))
Currently translated at 99.9% (9165 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-05-21 18:35:36 +02:00
pominglee 5dbc1c7b18 Translated using Weblate (Chinese (Traditional))
Currently translated at 99.9% (9165 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-05-21 18:35:36 +02:00
Toni Laiho 5780a15468 Translated using Weblate (Finnish)
Currently translated at 99.9% (9168 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-05-21 18:35:36 +02:00
Ulices 15f6d5ad73 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9171 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-05-21 18:35:36 +02:00
Nguyễn Ngọc Khánh 421bc27181 Translated using Weblate (Vietnamese)
Currently translated at 21.1% (1937 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-05-21 18:35:36 +02:00
Tokita, Hiroshi afe41498c4 Translated using Weblate (Japanese)
Currently translated at 99.9% (9167 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-05-21 18:35:36 +02:00
Tokita, Hiroshi 92c40f2761 Translated using Weblate (Japanese)
Currently translated at 99.9% (9167 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-05-21 18:35:36 +02:00
Toni Laiho bb82d99a76 Translated using Weblate (Finnish)
Currently translated at 99.9% (9168 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-05-21 18:35:36 +02:00
Andrew 1d0e118294 Translated using Weblate (Chinese (Traditional))
Currently translated at 99.9% (9165 of 9171 strings)

Co-authored-by: Andrew <yenchang.lin@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
Translation: KiCad EDA/v8
2024-05-21 18:35:36 +02:00
pominglee d40b12301d Translated using Weblate (Chinese (Traditional))
Currently translated at 99.9% (9165 of 9171 strings)

Co-authored-by: pominglee <pominglee@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
Translation: KiCad EDA/v8
2024-05-21 18:35:36 +02:00
Toni Laiho 138d22b26f Translated using Weblate (Finnish)
Currently translated at 99.9% (9165 of 9171 strings)

Co-authored-by: Toni Laiho <apelegeos@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
Translation: KiCad EDA/v8
2024-05-21 18:35:36 +02:00
zly20129 9c69ea9df3 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9171 of 9171 strings)

Co-authored-by: zly20129 <zly20129@icloud.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
Laurens Holst 3395738e55 Translated using Weblate (Dutch)
Currently translated at 100.0% (9171 of 9171 strings)

Co-authored-by: Laurens Holst <laurens@grauw.nl>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
Henrik Kauhanen 6afc2e727b Translated using Weblate (Finnish)
Currently translated at 99.7% (9148 of 9171 strings)

Translated using Weblate (Finnish)

Currently translated at 99.7% (9148 of 9171 strings)

Translated using Weblate (Swedish)

Currently translated at 99.9% (9168 of 9171 strings)

Co-authored-by: Henrik Kauhanen <henrik@kauhanen.se>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
Wellington Terumi Uemura f10864b3a7 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9171 of 9171 strings)

Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
ZbeeGin 892602c070 Translated using Weblate (Polish)
Currently translated at 99.9% (9169 of 9171 strings)

Co-authored-by: ZbeeGin <zbeegin@op.pl>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
Jeff Young d8f2a455e0 Reset zone offsets when exporting footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17794

(cherry picked from commit af5ed5a118)
2024-05-21 11:41:07 +01:00
Jeff Young 561b2d490d Handle font when reading render cache.
(Also fixes a bug where the cache's triangulation wasn't
cached.)

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

(cherry picked from commit e332320108)
2024-05-21 11:36:36 +01:00
jean-pierre charras 1869da0e7d Dialog Export step: fix an issue when exporting a modified board file.
the DIALOG_EXPORT_STEP uses a auto saved copy of the current board to
create the step file (using kicad_cli).
But this file is not associated to a corresponding .kicad_pro file, and
this can create some issues (like the KIPRJMOD not defined)
So create a copy of the current board prj to export associated prj file
to the auto saved board file.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16973
2024-05-21 11:06:02 +02:00
dsa-t be2f317f6d Vertically center the color swatch in grid layer selector.
(cherry picked from commit 5f153eef7f)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-05-21 02:35:49 +00:00
Seth Hillbrand c248993a84 Avoid snapping to edge cuts when routing
Snapping happens to elements on copper layers but edge cuts is only
_virtually_ on copper layers.  We need to set its routable flag off to
ensure we don't force-snap to the snap points
2024-05-20 15:08:12 -07:00
Seth Hillbrand 0a227ea916 Avoid int overflow in collisions
When calculating arc collisions, avoid overflowing the integer distance,
which gives a false nearest point
2024-05-20 15:08:12 -07:00
Seth Hillbrand f75e6dae84 Reserve shift for grid modification 2024-05-20 15:08:12 -07:00
Seth Hillbrand 160a493885 Ensure that arc closest positions are matched
We switch from squared to absolute calcualtion when calling into the arc
collision so be sure to catch the new positions and distances
2024-05-20 15:08:12 -07:00
Seth Hillbrand 625d241adf Avoid case where whole line is new head
If the whole line shifts, we may have no points of the old tail in the
new line.  In this case, we may not only not find the split point but we
may also have fewer points in the new line than were in the old head.
Clamping to the maximum potential point count prevents creating invalid
lines

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

(cherry picked from commit 586fddeec1)
2024-05-20 15:08:12 -07:00
Alex Shvartzkop 1264230973 STEP export: reverse Wire when adding it to Face as a hole.
Better fix for https://gitlab.com/kicad/code/kicad/-/issues/17446
2024-05-19 03:51:53 +03:00
Alex Shvartzkop 6dfd417767 Make IBIS errors visible / more obvious.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18041
2024-05-19 01:44:16 +03:00
Jon Evans 585f11a01d Clear undo/redo lists when removing board layers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17613


(cherry picked from commit 90ee5e097a)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-18 22:16:28 +00:00
Jon Evans d6a121d617 Don't drag multiple coincident vias
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17915


(cherry picked from commit 7a3db2d176)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-18 21:51:09 +00:00
Alex Shvartzkop dfd8aa402d Fix an assert in isCopperOutside. 2024-05-18 22:50:13 +03:00
Alex Shvartzkop 5b1c84b5dd STEP export: allow closing (and constructing) the wire with 1nm edges.
This is ok (and required) because we don't mess with BRepBuilderAPI::Precision nowadays.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18030
2024-05-18 22:50:13 +03:00
Jon Evans 11586863cf Fix broken hit test for arcs in via placer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17844


(cherry picked from commit aaf3142e9a)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-18 17:12:34 +00:00
Jon Evans d52e50a97a Altium: avoid crash when imported zone has no fill
Fix https://gitlab.com/kicad/code/kicad/-/issues/18025


(cherry picked from commit 4f3117aea0)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-18 00:16:22 +00:00
Jon Evans fee0028ee9 Support LIB_ID queries in searchFootprints too
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18039
2024-05-17 13:57:17 -04:00
Jon Evans a762311733 The upcoming Fedora 41 will use python 3.13
The Fedora folks are currently working on updating python to version
3.13 in Fedora 41.


(cherry picked from commit f8c8dcde13)

Co-authored-by: Steven A. Falco <stevenfalco@gmail.com>
2024-05-17 14:50:03 +00:00
Jon Evans e0581370e1 Fix bogus value field in spice test source.
(cherry picked from commit a0a368f47b)

Co-authored-by: Jeff Young <jeff@rokeby.ie>
2024-05-17 14:30:23 +00:00
Jon Evans 2cd0139cbf Remove extra NeedRIGHT in textbox parser
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18033
2024-05-17 09:01:59 -04:00
Jeff Young 28cd2a203e Fix compiler version issues. 2024-05-17 12:59:30 +01:00
Jeff Young 33715143e3 Honour LAYER, SHEETNAME and SHEETPATH variable overrides on CLI.
Also allows the LAYER variable to work automatically
if you're plotting/exporting a single layer.

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

(cherry picked from commit 3e0c598500)
2024-05-17 11:38:56 +01:00
Jeff Young ba6fd2716e Lazily re-evaluate worst-clearance cache.
This prevents crashes when trying to re-evaluate
during destruction, etc. and is a cleaner solution
than trying to keep a flag updated.

It should also be a performance win for very large
documents.

Also implements proper threadlocking for the cache.

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

(cherry picked from commit 498d2c9db1)
2024-05-17 11:37:04 +01:00
Jeff Young 882ff06e24 More PEGTL tomfoolery.
(cherry picked from commit 8aaca0509c)
2024-05-17 11:25:26 +01:00
Jeff Young f52a51dce3 Reimplement bracedExpr and token lists for CPL models only.
This prevents the incompatibility between token lists
and single-token param-value pairs.

(cherry picked from commit 086e609c3d)
2024-05-17 11:25:22 +01:00
Jeff Young a96e16b766 Tighter control over braced-expression list separators.
(cherry picked from commit 2921d47fb3)
2024-05-17 11:25:19 +01:00
Jeff Young 81e51b00ca Remove support for multiple token values for CPL models.
It breaks param lists which contain single-token params
(ie: those without the "=<value>" part).

(cherry picked from commit 8bb807f170)
2024-05-17 11:25:15 +01:00
Jeff Young c01681a32e Repair variable resolution recursion guard.
(cherry picked from commit c8d1c1f1a4)
2024-05-17 11:24:37 +01:00
Jeff Young eeb9133588 Support multiple brace-expressions for CPL model lines.
(Nested brace-expressions, on the other hand, are *not*
an ngspice thing.)

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

(cherry picked from commit 0008991f02)
2024-05-17 11:24:21 +01:00
Jeff Young d45769e508 Allow .ends to be preceeded by whitespace.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16560

(cherry picked from commit b934914c59)
2024-05-17 11:21:47 +01:00
Jeff Young a499bc9f66 Contour cache must be sensitive to size.
(While we scale the contours afterwards, font hint
data is size-sensitive so the contours are already
size-specific.)

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

(cherry picked from commit 98f4e60b90)
2024-05-17 11:20:38 +01:00
Jeff Young 341f102d79 Fix PEGTL flagParam grammar.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16393

(cherry picked from commit c5162f5483)
2024-05-17 11:20:26 +01:00
Jeff Young 3e50a03ce7 Expose violation severity for co-located holes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18028

(cherry picked from commit 26906f383c)
2024-05-17 11:20:21 +01:00
Jon Evans 1defa3872e Clear field listener when quitting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18016


(cherry picked from commit 2836025402)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-17 00:50:48 +00:00
jean-pierre charras e66d25b6e8 Eeschema, Pin helpers: fix wrong label orientation if the symbol is rotated
From Master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18012
2024-05-16 19:53:23 +02:00
jean-pierre charras 76f38600af Fix a 100% CPU core usage is some editing cases.
In commit 7cb754dd a call to wxMilliSleep(50) was removed (because it created
lag in editing) but this removal created a 100% CPU core usage.
Using a much small sleep time (1ms) fixes these issues.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17979
2024-05-16 17:40:06 +02:00
John Beard 44b0ef64e8 No longer auto-set the Footprint field when setting the FPID
This avoids forcing the field to the footprint name in the
library editor, which gets in the way. This doesn't specifically
inhibit the use of the field, and doesn't interfere with fields
users may have set manually (it can be cleared manually if
wished).

Removing the footprint field entirely either from all footprints
or from footprints in fpedit is quite a bit more invasive to
existing designs.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/17998
2024-05-16 21:42:18 +08:00
John Beard c3e7509823 Allow to set LIB_FIELD size through property manager
This can be useful when managing auxiliary fields.

This is only for the 8.0 branch, as LIB_FIELD is merged
with SCH_FIELD in 8.99, so this is already handled.
2024-05-16 20:45:26 +08:00
Jeff Young 3622a296be Use consistent sorting for footprint libs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17731

(cherry picked from commit 02bc093b55)
2024-05-15 11:25:41 +01:00
Jeff Young 0b48913876 Add mirrored column to fields grid table.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17956

(cherry picked from commit 0f3d14df38)
2024-05-15 11:25:02 +01:00
Jeff Young 9000cfb9cd Use display titles for axes in CSV output.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17324

(cherry picked from commit d9a6b2aec2)
2024-05-15 11:23:52 +01:00
Jeff Young c748645334 Fix typo.
(cherry picked from commit 5ba4900170)
2024-05-15 11:23:07 +01:00
Jeff Young 79443b7e59 Update signals & measurements when netlist might have changed.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17616

(cherry picked from commit 55b2c4dbf4)
2024-05-15 11:22:08 +01:00
Mark Roszko 02925fdecc Update file doxygen.yml
(cherry picked from commit 3a2b960f62)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-05-12 02:53:57 +00:00
Mark Roszko ef1e054bb6 Use our docker runner for doxygen
docker tag for shared gitlab runners was removed by gitlab

(cherry picked from commit 03459723b3)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-05-12 01:09:42 +00:00
Mark Roszko bb13ab2963 Remove the kicad-vcpkg xz override
(cherry picked from commit 695493fc3d)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-05-10 01:44:39 +00:00
Jeff Young 9c7fb0697c Don't double up ac and ph params.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17970
2024-05-09 23:36:32 +01:00
Jeff Young c92b11900b Don't add duplicate SIM fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17970
2024-05-09 23:36:32 +01:00
Jeff Young cde18d7ae7 The user can cancel the opening of many editors.
Don't play dice with the devil.

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

(cherry picked from commit a99377c1ec)
2024-05-09 23:36:32 +01:00
Jeff Young 1a932cb13b Don't modify radius when editing center.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17192

(cherry picked from commit 1290228fbf)
2024-05-09 23:36:32 +01:00
Jeff Young cc75d8c0af Exercise more care when comparing doubles.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17249

(cherry picked from commit 62d4bd7c1d)
2024-05-09 23:36:32 +01:00
Wayne Stambaugh cb93d2940c Fix QA DRC regression test issue.
(cherry picked from commit f1e8495dc9)
2024-05-09 10:38:47 -04:00
Wayne Stambaugh 88e0d373d1 Do not test for effective annular width when it's already within limits.
(cherry picked from commit 0402c03468)
2024-05-09 10:38:32 -04:00
Wayne Stambaugh c2d59c6103 Fix false annular ring width DRC test failure.
The DRC annular ring width test failed to take into account that a pad
could be contained inside another pad having the same number (thermal
vias for example) which changes the effective annular width of the pad
contained within another pad.  A test was added to calculate the effective
annular ring width in this case.

Added some PNS log viewer helper and test code to the PNS playground QA
utility for testing the effective pad annular width code.

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

(cherry picked from commit a508f2e716)
2024-05-09 10:38:17 -04:00
Seth Hillbrand f8f48f922e Show disambiguated netname when needed
When using subsheets with nets that end in the same netname, it can be
confusing in pcbnew to know which net you are dealing with.  In these
cases, we show the full netname including path to assist when routing

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

(cherry picked from commit b346cde30b)
2024-05-09 02:57:48 +02:00
Alex Shvartzkop eb7e781bec Send project path to ngspice for code model input files.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16527
2024-05-08 23:39:34 +03:00
Alex Shvartzkop 378300c733 Don't hide symbol/footprint preview widgets on scroll.
(cherry picked from commit dc8822b421)
2024-05-08 19:44:59 +03:00
Jon Evans ddd7c35586 DbLib: Prevent uncaught exception creating statement
Defer telling the statement about the connection until the
try block, because otherwise it can connect immediately and
potentially throw an exception if the connection fails.
2024-05-06 16:59:49 -04:00
Seth Hillbrand 6482a322da Optionally use electrical type when shown.
We also need to consider electrical type as an exact hit when we are
showing it.  Otherwise, we get the pin added to our consideration list
but not selected without hitting close neighbors

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

(cherry picked from commit 3620887a22)
2024-05-06 10:38:28 -07:00
Seth Hillbrand dc6d421fa2 Avoid arbitrary string limits
Placing a limit on the number of values that a field is allowed to hold
makes it blank when we set more than this number.  There's not a good
reason to limit the number of digits we allow at the field level (we
round to 4 decimal points in the backend)

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

(cherry picked from commit cb71f2f207)
2024-05-06 10:00:51 -07:00
Mike Williams 7b19fb0c8d Legacy Libraries: fix Description field clobbering user field
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17943
2024-05-06 12:15:14 -04:00
Mark Roszko f6480d67eb Fix help for kicad-cli pcb export pos --side
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15815


(cherry picked from commit 030a251090)

0b94c436 fix https://gitlab.com/kicad/code/kicad/-/issues/15815
8e6bb91b Update file command_pcb_export_pos.cpp

Co-authored-by: Stefan <2252537-stefan_test@users.noreply.gitlab.com>
2024-05-06 13:37:03 +00:00
Alex Shvartzkop 35c788a332 Fix polygon fill flag in pcbnew graphics (SVG) importer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17957
2024-05-06 14:16:49 +03:00
Seth Hillbrand a0cba3a9af Re-initialize conversion settings on failure
When the conversion fails, it may be the result of the settings values,
so reset them to their original values afterward

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

(cherry picked from commit 4c0fd6e791)
2024-05-06 11:42:54 +01:00
Jeff Young af6835e766 Improve bounding hull error message.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17886

(cherry picked from commit 651cc5c838)
2024-05-06 11:42:34 +01:00
Mike Williams 1f88d33c81 BOM Export: remember filename per project
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17704
(cherry picked from commit 9c058503d9)
2024-05-06 11:38:15 +01:00
Jeff Young 6aee6f857e Don't leak output file path between projects.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17846

(cherry picked from commit 0e9b547f94)
2024-05-06 11:37:52 +01:00
jean-pierre charras 6d69fee097 PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(): ensure texts are not mirrored
When not specified as mirrored, texts must be not mirrored.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17955
2024-05-06 11:17:17 +02:00
Alex Shvartzkop c7dd993439 Add OpenGL info to About.
(cherry picked from commit 5e14ae9698)
2024-05-05 21:58:10 +03:00
Jeff Young 7e5dd02ef1 Don't abort on failure to backup file if it was never saved.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17810

(cherry picked from commit 0e0432d194)
2024-05-05 14:59:07 +01:00
Jon Evans ca16ff05df Altium pcbimport: handle various dimension items, fix dimension_kind enum
(cherry picked from commit ce32dfd077)

e627d587 handle various dimension items, fix dimension_kind enum, this doesn't parse...
e89d1826 fix formating
07686833 change to Reporter for logging
a535d13d remove old comments
554c9565 Update file altium_pcb.cpp

Co-authored-by: Stefan <2252537-stefan_test@users.noreply.gitlab.com>
2024-05-04 16:38:32 +00:00
Jon Evans b8fa10ab2b Add optional reporting of non-KiCad design issues
Also add HTML reporter to PCB side to match schematic
2024-05-04 11:27:22 -04:00
Jon Evans 09736ebf2c Get rid of relative position in pad properties dialog
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17246
2024-05-03 23:31:36 -04:00
Jeff Young 897b9fe6a1 Restore accidentally deleted text size constraint algo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17284

(cherry picked from commit c998234dec)
2024-05-03 22:16:16 +01:00
Jeff Young 48f14d6dea Handle orientation when pasting footprint items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17518

(cherry picked from commit 94223ca794)
2024-05-03 22:15:53 +01:00
Jeff Young 1ef916086d pruneItemLayers() is not the right place to filter refdes & value.
(And we already filter all mandatory fields in
pasteFootprintItemsToFootprintEditor() anyway.)

Also, don't nuke a footprint which contains only fields
during a paste.

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

(cherry picked from commit eb13dec265)
2024-05-03 22:15:05 +01:00
Jeff Young 0b44ba61d8 Improve consistency in free-via ambiguity tests.
Also removes a magic number.

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

(cherry picked from commit 58ddffe3dd)
2024-05-03 22:15:05 +01:00
Jon Evans 3c99a3797e DbLib: Fill entire table if cache is empty when loading one part
The "already placed parts" feature causes a situation where many
single-part queries are placed before the cache is even filled.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17940
2024-05-03 17:03:55 -04:00
Seth Hillbrand 76c98859bf Fix renaming sheet check
If we are renaming a sheet that exists only once in the schematic, then
we don't need to warn about case sensitivity.  If the sheet exists
multiple times, we do.  We can't check this using SCREENS because the
screens don't maintain full state information about where they are used.

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

(cherry picked from commit ba4974749c)
2024-05-03 13:23:51 -07:00
Seth Hillbrand 57c8fbc9fe Special-case copy/paste of footprint fields on board
When editing the board, footprint fields _look_ like text items, so copy
and paste of these items should logically result in a text item, not a
footprint copy.

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

(cherry picked from commit 71b020eb14)
2024-05-03 11:00:19 -07:00
Seth Hillbrand bbac5430cf DRC: special case circles for annular width check
Circles only use one dimension and we tend to ignore the other in our UI
but it is kept and reflects the previous second dimensional value.  When
checking DRC, we should only be concerned with the single value used
unless the pad has two dimensions

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

(cherry picked from commit e3d2f338de)
2024-05-03 10:07:29 -07:00
Seth Hillbrand 279ef4210d Use StandardPrimitive library for vias
Some 2581 parsers don't like to consider UserPrimitive even though they
are essentially the same thing and required by the standard.  ¯\_(ツ)_/¯

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

(cherry picked from commit 13735050da)
2024-05-03 09:12:43 -07:00
Jon Evans 2ef18ad4ca Fix deduplication of already-placed symbols
The comparison function was failing to properly
de-duplicate by LIB_ID, especially for parts
from database libraries, causing the list to grow
with the size of the design.
2024-05-03 11:39:01 -04:00
Jon Evans 1a76fce255 Make sure database library has updated pointer to library table
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17903
2024-05-03 11:39:01 -04:00
Mark Roszko ee75a50d84 Update vcpkg wxpython
(cherry picked from commit 1a1be2d542)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-03 02:17:30 +00:00
Mark Roszko 99d8d0bc63 Use the new kmb toolchain file for vars
(cherry picked from commit f00a1ab517)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-05-03 02:15:52 +00:00
Mark Roszko f859fe37ca Add updated tooltips on update dialog
(cherry picked from commit cb81de5a74)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-03 01:39:50 +00:00
Alex Shvartzkop 451cb7a194 Fix warnings. 2024-05-03 00:09:24 +03:00
Alex Shvartzkop 17175fe71e EasyEDA Std/Pro: import (some) component metadata for symbols.
Also fixes Reference numbering.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17806
2024-05-03 00:05:39 +03:00
Seth Hillbrand f8b02f99dd Keep FP chooser on top of KiCad but not system
We don't need to float the window over other programs, so setting to
parental floating keeps it focused just the right amount

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

(cherry picked from commit 60f59ae851)
2024-05-02 13:12:21 -07:00
Seth Hillbrand 69fb86322c Re-allow moving footprint text
This is a temporary solution until we modify loading to convert existing
text to fields

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

(cherry picked from commit b649932dbf)
2024-05-02 13:00:37 -07:00
Seth Hillbrand 4d683232b7 Remove faulty tooltip
Copy-pasta error

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

(cherry picked from commit b211625e53)
2024-05-02 12:46:26 -07:00
Jon Evans cb7e0e4383 Altium: apply power filter to symbol libraries
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17922
2024-05-01 22:47:19 -04:00
Jon Evans 90b62762d3 Support ortho dragging labels off sheet pins 2024-05-01 22:10:18 -04:00
Jon Evans 787a9ae4e4 Pin helpers can help sheet pins also
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17923
2024-05-01 22:10:02 -04:00
Jon Evans 83be5ba63d Move ALTIUM_PCB to use REPORTER for logging
Change not-yet-supported messages to debug level

(cherry picked from commit e973c15087)
2024-05-01 19:17:09 -04:00
Jeff Young e1cad6189e Don't assume that a SMD pad has copper layers.
(cherry picked from commit 9a6efd43e1)
2024-05-01 18:29:36 +01:00
Mike Williams f29fc2a025 PCB Fields: fix v7 imported board hidden description field pos
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17684
2024-05-01 09:24:54 -04:00
Mark Roszko 43d4c8d801 Point BEGIN_EVENT_TABLE at the correct base class, fix current lang indication
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17825


(cherry picked from commit aaf776db9e)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-01 02:48:19 +00:00
Wayne Stambaugh c179f4d4f1 Use correct value field text when importing Eagle schematic symbols.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17130

(cherry picked from commit 865225fcca)
2024-04-30 13:02:29 -04:00
jean-pierre charras ac8b3989be DIALOG_EXPORT_2581:fix incorrect size of widgets when a very long field name exists
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17911
2024-04-30 18:22:22 +02:00
Mark Roszko 9a7b1a20dc Update sentry-native to 0.7.2
(cherry picked from commit 2f0ff4e557)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-04-30 11:39:47 +00:00
Alex Shvartzkop cff58bae7f Fix internal simulation errors when using some IBIS models.
Usage of GC_PWR0 looked like a copy/paste.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17701
2024-04-29 23:24:46 +03:00
Jeff Young 2ee2d7d5d9 Separate Compare Footprints from DRC.
(We want to ignore some of the flags for DRC.)

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

(cherry picked from commit 43e6006306)
2024-04-29 16:27:24 +01:00
Jeff Young 743759578d Use a lighter touch keeping internal data structures in sync.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17493

(cherry picked from commit d0df8df7c7)
2024-04-29 13:45:17 +01:00
Mark Roszko 9f1d1fc45e Delete m_locale in the pgm_base destructor instead of manual destroy method
We need the object in m_locale for a bit more things during program cleanup,
especially on macOS

The destructor of PGM_BASE is sufficient allowance of lifetime.

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


(cherry picked from commit 9ffa5db667)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-04-29 11:48:22 +00:00
Mark Roszko b4ea25dccb Bump kicad-vcpkg baseline 2024-04-29 11:10:29 +00:00
Alex Shvartzkop f15551a6b5 3D viewer: apply OCC colors in order: XCAFDoc_ColorSurf > XCAFDoc_ColorCurv > XCAFDoc_ColorGen
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14906
2024-04-29 01:25:31 +03:00
Jeff Young 5c0a654e1e Save project settings after Schematic Setup.
This prevents data from getting lost if we later crash.

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

(cherry picked from commit d8d816236c)
2024-04-28 21:54:16 +01:00
Jeff Young edace908fb Make sure color settings are saved when modified.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17864

(cherry picked from commit 3b3de58e5e)
2024-04-28 21:54:16 +01:00
Jeff Young ff966eaf62 Gracefully handle DNP & Excl-from-brd components in nets list.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17146

(cherry picked from commit 9be60cb45d)
2024-04-28 21:54:16 +01:00
Jeff Young a39b9b8890 Support legacy Length Tuning Settings workflow.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17748

(cherry picked from commit 978ef352d0)
2024-04-28 21:54:16 +01:00
Jeff Young 9f39420808 Layer column should be shown by default, not italic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17758

(cherry picked from commit 9dab855f8d)
2024-04-28 21:54:16 +01:00
Jeff Young 67b5e86cc4 Default to target lib when no lib tree sel exists.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17808

(cherry picked from commit f51d227dc7)
2024-04-28 21:54:16 +01:00
Jeff Young baaa8b6537 Fix merge error. 2024-04-28 21:54:16 +01:00
Jeff Young 4f776050e6 Clean up selection logic.
Don't try to do too many things at once.  Separate
out fooptrint-children handling, visibility-handling,
and footprintEditor vs boardEditor differences.

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

(cherry picked from commit 3958d1bf14)
2024-04-28 21:54:16 +01:00
Jeff Young fa490644dd Allow selection promotion when editing wrong field type.
Also fixes a bug where a CHT_MODIFY on a parent symbol with a
selected child doesn't trigger a selection modified event.

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

(cherry picked from commit 1aa59b806c)
2024-04-28 21:54:16 +01:00
Jeff Young 0363806e7e Allow no-net teardrops on no-net pads with no-net tracks.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17566

(cherry picked from commit 50567764b5)
2024-04-28 21:54:16 +01:00
Jeff Young c0a608bfdd Keep internal data consistent when changing pad type.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17493

(cherry picked from commit 859f553c91)
2024-04-28 21:54:16 +01:00
Jeff Young fe26628113 Internationalise pin info when language changes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17224

(cherry picked from commit c5c65f23a4)
2024-04-28 21:54:16 +01:00
Alex Shvartzkop c7ead70e0f Fix orientations of some footprint STEP models.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17631

(cherry picked from commit 7d37cebfdf)
2024-04-28 23:19:34 +03:00
Wayne Stambaugh 31177be88f Property grid navigation improvements.
* Do not handle tab key event when committing property changes so the
  property grid tab navigation works correctly.
* Do not call commit property changes on tab key when no changes are
  pending.
* Skip event handling in the base object value change and changing event
  handlers in case they do not get overloaded in derived objects.
* Do not force focus to canvas on property change so arrow and tab key
  grid navigation work properly.  Forcing the user to click the property
  grid control to edit a single property doesn't make sense.
* Pass properties panel show event up the event stack.
* Do not set focus to canvas in tool dispatcher if it already has the
  focus.

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

manully cherry picked from commit 8a1347d2c8
2024-04-28 08:25:24 -04:00
Wayne Stambaugh 48fd6bab7b Symbol chooser dialog layout improvements.
(cherry picked from commit 33869dbb61)
2024-04-28 07:43:43 -04:00
Wayne Stambaugh 9fd2b32665 Do not show click to start wire cursor for hidden pins.
Selecting show hidden pins will allow users to connect to hidden pins.

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

(cherry picked from commit ca18dc8ec8)
2024-04-28 07:39:34 -04:00
Wayne Stambaugh 1ba05d4c9c Improve symbol instance data file save ordering.
Use the root schematic UUID to order projects and sort symbol instance
data by KIID_PATH.  This will ensure file changes to instance data are
more consistent by using a fixed ordering.

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

(cherry picked from commit a86a258f66)
2024-04-28 07:15:22 -04:00
Wayne Stambaugh bae3ccdfb5 Use correct project name when adding new symbol instances.
When adding a sheet using a schematic from another project, set the
project name for the new symbol instance data to the current project
rather than the project name from the copied instance data.

(cherry picked from commit 5d99aaf0a4)
2024-04-28 07:06:03 -04:00
Alex Shvartzkop dd2f15c96d QA: update Altium footprint library golden file. 2024-04-27 23:34:39 +03:00
Marek Roszko 7e04a1b8d3 Hackfix macOS to keep erc/drc on top
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14356
2024-04-27 13:38:41 -04:00
Mark Roszko aea70a14ff Fix win32 proxy parsing when the old IE options for scheme based configuration was set
If you uncheck in the old IE options "Use the same proxy server for all protocols", then it returns an annoying string
like http=blah:1232;https=blah:1232;ftp=blah:2321 which we have to parse.


(cherry picked from commit 60d5780c1c)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-04-27 17:30:03 +00:00
dsa-t 8edfc23679 Altium PCB import: pad thermal spoke angle is 90 deg by default.
(cherry picked from commit 11ba59b690)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-04-27 17:27:07 +00:00
dsa-t 87f3d45109 Require Wayland 1.20 libraries.
KiCad doesn't build with older versions due to missing definitions.


(cherry picked from commit e26778c599)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-04-27 17:26:57 +00:00
Wayne Stambaugh 2ca07b47af Begin version 8.0.3 development. 2024-04-27 13:10:22 -04:00
1081 changed files with 185572 additions and 142597 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ build_doxygen_docker:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_JOB_NAME == "doxygen"
tags:
- docker
- gitlab-org-docker
before_script:
- docker info
- docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
+1 -19
View File
@@ -15,25 +15,7 @@ macos_build:
- cd build/macos
- cmake
-G Ninja
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DDEFAULT_INSTALL_PATH=/Library/Application\ Support /kicad
-DOCC_INCLUDE_DIR=/opt/homebrew/Cellar/opencascade/7.7.2_2/include/opencascade
-DOCC_LIBRARY_DIR=/opt/homebrew/Cellar/opencascade/7.7.2_2/Lib
-DCMAKE_INSTALL_PREFIX=/Users/ci/kicad-mac-builder/build/kicad-dest
-DCMAKE_C_COMPILER=/usr/bin/clang
-DCMAKE_CXX_COMPILER=/usr/bin/clang++
-DwxWidgets_CONFIG_EXECUTABLE=/Users/ci/kicad-mac-builder/build/wxwidgets-dest/bin/wx-config
-DKICAD_BUILD_I18N=ON
-DKICAD_SCRIPTING_WXPYTHON=ON
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON
-DPYTHON_EXECUTABLE=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/bin/python3
-DPYTHON_INCLUDE_DIR=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/include/python3.9/
-DPYTHON_LIBRARY=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/lib/libpython3.9.dylib
-DPYTHON_SITE_PACKAGE_PATH=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/lib/python3.9/site-packages
-DPYTHON_FRAMEWORK=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework
-DNGSPICE_INCLUDE_DIR=/Users/ci/kicad-mac-builder/build/ngspice-dest/include
-DNGSPICE_LIBRARY=/Users/ci/kicad-mac-builder/build/ngspice-dest/lib/libngspice.dylib
-DKICAD_USE_3DCONNEXION=ON
-DCMAKE_TOOLCHAIN_FILE=/Users/ci/kicad-mac-builder/toolchain/kicad-mac-builder.cmake
../../
- cmake --build . 2>&1 | tee compilation_log.txt
- cd ../../
+7 -1
View File
@@ -381,7 +381,13 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
fclose( fp );
unsigned int digest[5];
dblock.get_digest( digest );
// V8 only
// Boost 1.86 and later changed digest_type from uchar[20] from int[5]
// But KiCad 8.99 and later use MurmurHash3 here, so just do a fairly ugly cast to keep
// this going for another few months.
static_assert( sizeof( digest ) == sizeof( boost::uuids::detail::sha1::digest_type& ),
"SHA1 digest size mismatch" );
dblock.get_digest( reinterpret_cast<boost::uuids::detail::sha1::digest_type&>( digest ) );
// ensure MSB order
for( int i = 0; i < 5; ++i )
+2
View File
@@ -708,6 +708,8 @@ void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
for( const auto& [ layer, color ] : aColors )
settings->SetColor( layer, color );
Pgm().GetSettingsManager().SaveColorSettings( settings, "3d_viewer" );
}
@@ -374,6 +374,13 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
// Remove group membership from dummy item before deleting
dummy.SetParentGroup( nullptr );
}
else if( aPad->GetShape() == PAD_SHAPE::CUSTOM )
{
// A custom pad can have many complex subshape items. To avoid issues, use its
// final polygon shape, not its basic shape set. One cannot apply the clearance
// to each subshape: it does no work
aPad->TransformShapeToPolygon( poly, aLayer, 0, maxError );
}
else
{
auto padShapes = std::static_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
@@ -422,7 +429,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
break;
case SH_POLY_SET:
poly = *(SHAPE_POLY_SET*) shape;
poly.Append( *static_cast<const SHAPE_POLY_SET*>( shape ) );
break;
case SH_ARC:
+5 -1
View File
@@ -185,8 +185,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
for( PCB_TRACK* track : m_board->Tracks() )
{
if( !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) ) // Skip non enabled layers
// Skip tracks (not vias that are on more than one layer ) on disabled layers
if( track->Type() != PCB_VIA_T
&& !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) )
{
continue;
}
// Note: a PCB_TRACK holds normal segment tracks and also vias circles (that have also
// drill values)
+9
View File
@@ -33,6 +33,7 @@
#include <3d_rendering/opengl/render_3d_opengl.h>
#include <3d_viewer_id.h>
#include <advanced_config.h>
#include <build_version.h>
#include <board.h>
#include <reporter.h>
#include <gal/opengl/gl_context_mgr.h>
@@ -229,6 +230,9 @@ bool EDA_3D_CANVAS::initializeOpenGL()
From_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
}
SetOpenGLInfo( (const char*) glGetString( GL_VENDOR ), (const char*) glGetString( GL_RENDERER ),
(const char*) glGetString( GL_VERSION ) );
wxString version = From_UTF8( (char *) glGetString( GL_VERSION ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::%s OpenGL version string %s." ),
@@ -748,6 +752,11 @@ void EDA_3D_CANVAS::OnLeftDown( wxMouseEvent& event )
SetFocus();
stop_editingTimeOut_Timer();
// Ensure m_camera.m_lastPosition (current mouse position) is up to date for
// future drag events (can be not the case when left clicking after
// opening a context menu)
OnMouseMoveCamera( event );
if( !event.Dragging() && ( m_3d_render_raytracing != nullptr ) )
{
RAY mouseRay = getRayAtCurrentMousePosition();
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -35,6 +35,7 @@
#include "../3d_cache/3d_cache.h"
#include <wx/dcclient.h>
#include <base_units.h>
#include <build_version.h>
#include <gal/opengl/gl_context_mgr.h>
#include <settings/common_settings.h>
#include <pgm_base.h>
@@ -102,11 +103,6 @@ EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribL
m_BiuTo3dUnits = 1.0;
m_glRC = nullptr;
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
const DPI_SCALING_COMMON dpi{ settings, this };
SetScaleFactor( dpi.GetScaleFactor() );
}
@@ -200,6 +196,9 @@ void EDA_3D_MODEL_VIEWER::ogl_initialize()
From_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
}
SetOpenGLInfo( (const char*) glGetString( GL_VENDOR ), (const char*) glGetString( GL_RENDERER ),
(const char*) glGetString( GL_VERSION ) );
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
+2
View File
@@ -1,6 +1,8 @@
add_library(3d-viewer_navlib STATIC
"nl_3d_viewer_plugin.cpp"
"nl_3d_viewer_plugin_impl.cpp"
"nl_footprint_properties_plugin.cpp"
"nl_footprint_properties_plugin_impl.cpp"
)
# 3d-viewer_navlib depends on make_lexer outputs in common
+3 -6
View File
@@ -25,20 +25,17 @@
NL_3D_VIEWER_PLUGIN::NL_3D_VIEWER_PLUGIN( EDA_3D_CANVAS* aViewport )
: m_impl( nullptr )
{
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
{
m_impl = new NL_3D_VIEWER_PLUGIN_IMPL( aViewport );
m_impl = std::make_unique<NL_3D_VIEWER_PLUGIN_IMPL>( aViewport, "KiCAD 3D" );
m_impl->Connect();
}
}
NL_3D_VIEWER_PLUGIN::~NL_3D_VIEWER_PLUGIN()
{
delete m_impl;
}
NL_3D_VIEWER_PLUGIN::~NL_3D_VIEWER_PLUGIN() = default;
void NL_3D_VIEWER_PLUGIN::SetFocus( bool focus )
+3 -1
View File
@@ -26,6 +26,8 @@
#ifndef NL_3D_VIEWER_PLUGIN_H_
#define NL_3D_VIEWER_PLUGIN_H_
#include <memory>
// Forward declarations.
class EDA_3D_CANVAS;
class NL_3D_VIEWER_PLUGIN_IMPL;
@@ -54,7 +56,7 @@ public:
void SetFocus( bool aFocus = true );
private:
NL_3D_VIEWER_PLUGIN_IMPL* m_impl;
std::unique_ptr<NL_3D_VIEWER_PLUGIN_IMPL> m_impl;
};
#endif // NL_3D_VIEWER_PLUGIN_H_
@@ -1,8 +1,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 3Dconnexion
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -27,6 +27,7 @@
// KiCAD includes
#include <tool/action_manager.h>
#include <tool/tool_manager.h>
#include <tool/tools_holder.h>
// stdlib
#include <map>
@@ -72,7 +73,7 @@ bool equals( glm::mat<L, C, T, Q> const& aFirst, glm::mat<L, C, T, Q> const& aSe
}
NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas ) :
NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas, const std::string& aProfileHint ) :
NAV_3D( false, false ),
m_canvas( aCanvas ),
m_capIsMoving( false ),
@@ -80,12 +81,7 @@ NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas ) :
{
m_camera = dynamic_cast<TRACK_BALL*>( m_canvas->GetCamera() );
PutProfileHint( "KiCAD 3D" );
EnableNavigation( true );
PutFrameTimingSource( TimingSource::SpaceMouse );
exportCommandsAndImages();
PutProfileHint( aProfileHint );
}
@@ -101,8 +97,19 @@ void NL_3D_VIEWER_PLUGIN_IMPL::SetFocus( bool aFocus )
NAV_3D::Write( navlib::focus_k, aFocus );
}
// temporary store for the categories
typedef std::map<std::string, TDx::CCommandTreeNode*> CATEGORY_STORE;
EDA_3D_CANVAS* NL_3D_VIEWER_PLUGIN_IMPL::GetCanvas() const
{
return m_canvas;
}
void NL_3D_VIEWER_PLUGIN_IMPL::Connect()
{
EnableNavigation(true);
PutFrameTimingSource(TimingSource::SpaceMouse);
exportCommandsAndImages();
}
/**
* Add a category to the store.
@@ -571,7 +578,7 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
if( parent->IsEnabled() )
{
TOOL_MANAGER* tool_manager = static_cast<PCB_BASE_FRAME*>( parent )->GetToolManager();
TOOL_MANAGER* tool_manager = dynamic_cast<TOOLS_HOLDER*>( parent )->GetToolManager();
if( tool_manager == nullptr )
{
+21 -4
View File
@@ -1,8 +1,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 3Dconnexion
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -42,6 +42,11 @@
class EDA_3D_CANVAS;
class TRACK_BALL;
// temporary store for the categories
typedef std::map<std::string, TDx::CCommandTreeNode*> CATEGORY_STORE;
CATEGORY_STORE::iterator add_category( std::string aCategoryPath, CATEGORY_STORE& aCategoryStore );
// Convenience typedef.
typedef TDx::SpaceMouse::Navigation3D::CNavigation3D NAV_3D;
@@ -56,8 +61,9 @@ public:
* Initializes a new instance of the NL_3DVIEWER_PLUGIN.
*
* @param aCanvas is the viewport to be navigated.
* @param aProfileHint tells the 3DConnexion UI which profile to use.
*/
NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas );
NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas, const std::string& aProfileHint );
virtual ~NL_3D_VIEWER_PLUGIN_IMPL();
@@ -69,11 +75,21 @@ public:
*/
void SetFocus( bool aFocus = true );
/**
* Get the m_canvas pointer.
*/
EDA_3D_CANVAS* GetCanvas() const;
/**
* Connect plugin implementation to the driver.
*/
void Connect();
private:
/**
* Export the invocable actions and images to the 3Dconnexion UI.
*/
void exportCommandsAndImages();
virtual void exportCommandsAndImages();
long GetCameraMatrix( navlib::matrix_t& aMatrix ) const override;
long GetPointerPosition( navlib::point_t& aPosition ) const override;
@@ -111,6 +127,7 @@ private:
long GetCoordinateSystem( navlib::matrix_t& aMatrix ) const override;
long GetIsViewRotatable( navlib::bool_t& isRotatable ) const override;
private:
EDA_3D_CANVAS* m_canvas;
TRACK_BALL* m_camera;
@@ -0,0 +1,45 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "nl_footprint_properties_plugin.h"
#include "nl_footprint_properties_plugin_impl.h"
#include <advanced_config.h>
#include <kiplatform/drivers.h>
NL_FOOTPRINT_PROPERTIES_PLUGIN::NL_FOOTPRINT_PROPERTIES_PLUGIN( EDA_3D_CANVAS* aViewport )
{
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
{
m_impl = std::make_unique<NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL>( aViewport );
m_impl->Connect();
}
}
NL_FOOTPRINT_PROPERTIES_PLUGIN::~NL_FOOTPRINT_PROPERTIES_PLUGIN() = default;
void NL_FOOTPRINT_PROPERTIES_PLUGIN::SetFocus( bool focus )
{
if( m_impl )
m_impl->SetFocus( focus );
}
@@ -0,0 +1,62 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file nl_footprint_properties_plugin.h
* @brief declaration of the nl_footprint_properties_plugin class
*/
#ifndef NL_FOOTPRINT_PROPERTIES_PLUGIN_H_
#define NL_FOOTPRINT_PROPERTIES_PLUGIN_H_
#include <memory>
// Forward declarations.
class EDA_3D_CANVAS;
class NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL;
/**
* The class that implements the public interface to the SpaceMouse plug-in.
*/
class NL_FOOTPRINT_PROPERTIES_PLUGIN
{
public:
/**
* Initializes a new instance of the NL_FOOTPRINT_PROPERTIES_PLUGIN.
*
* @param aViewport is the viewport to be navigated.
*/
NL_FOOTPRINT_PROPERTIES_PLUGIN( EDA_3D_CANVAS* aViewport );
virtual ~NL_FOOTPRINT_PROPERTIES_PLUGIN();
/**
* Set the connection to the 3Dconnexion driver to the focus state so that
* 3DMouse data is routed here.
*
* @param aFocus is true to set the connection active.
*/
void SetFocus( bool aFocus = true );
private:
std::unique_ptr<NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL> m_impl;
};
#endif // NL_FOOTPRINT_PROPERTIES_PLUGIN_H_
@@ -0,0 +1,162 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "nl_footprint_properties_plugin_impl.h"
#include <3d-viewer/3d_canvas/eda_3d_canvas.h>
// KiCAD includes
#include <tool/action_manager.h>
#include <tool/tool_manager.h>
#include <tool/tools_holder.h>
#include <wx/mstream.h>
#define BOUNDING_BOX_SCALE_FACTOR 1.3f
/**
* Flag to enable the NL_FOOTPRINT_PROPERTIES_PLUGIN debug tracing.
*
* Use "KI_TRACE_NL_FOOTPRINT_PROPERTIES_PLUGIN" to enable.
*
* @ingroup trace_env_vars
*/
const wxChar* NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::m_logTrace =
wxT( "KI_TRACE_NL_FOOTPRINT_PROPERTIES_PLUGIN" );
NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL(EDA_3D_CANVAS* aCanvas) :
NL_3D_VIEWER_PLUGIN_IMPL(aCanvas, "KiCAD Footprint Properties")
{}
long NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::GetModelExtents( navlib::box_t& extents ) const
{
SFVEC3F min = NL_3D_VIEWER_PLUGIN_IMPL::GetCanvas()->GetBoardAdapter().GetBBox().Min();
SFVEC3F max = NL_3D_VIEWER_PLUGIN_IMPL::GetCanvas()->GetBoardAdapter().GetBBox().Max();
SFVEC3F diff = ( BOUNDING_BOX_SCALE_FACTOR - 1.f ) / 2.f * ( max - min );
min -= diff;
max += diff;
extents = { min.x, min.y, min.z, max.x, max.y, max.z };
return 0;
}
void NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::exportCommandsAndImages()
{
std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
if( actions.size() == 0 )
{
return;
}
using TDx::SpaceMouse::CCommand;
using TDx::SpaceMouse::CCommandSet;
// The root action set node
CCommandSet commandSet( "EDA_3D_CANVAS", "3D Viewer" );
// Activate the command set
NAV_3D::PutActiveCommands( commandSet.GetId() );
// temporary store for the categories
CATEGORY_STORE categoryStore;
std::vector<TDx::CImage> vImages;
// add the action set to the category_store
categoryStore.insert( categoryStore.end(), CATEGORY_STORE::value_type( ".", &commandSet ) );
std::list<TOOL_ACTION*>::const_iterator it;
for( it = actions.begin(); it != actions.end(); ++it )
{
const TOOL_ACTION* action = *it;
std::string label = action->GetMenuLabel().ToStdString();
if( label.empty() )
{
continue;
}
std::string name = action->GetName();
// Do no export commands for the pcbnew app.
if( name.rfind( "pcbnew.", 0 ) == 0 )
{
continue;
}
// Exclude commands which can't be used in the footprint properties.
if( name.rfind( "3DViewer.Control.pivotCenter", 0 ) == 0
|| name.rfind( "3DViewer.Control.material", 0 ) == 0
|| name.rfind( "3DViewer.Control.attribute", 0 ) == 0
|| name.rfind( "3DViewer.Control.show", 0 ) == 0 )
{
continue;
}
std::string strCategory = action->GetToolName();
CATEGORY_STORE::iterator iter = categoryStore.find( strCategory );
if( iter == categoryStore.end() )
{
iter = add_category( std::move( strCategory ), categoryStore );
}
std::string description = action->GetDescription().ToStdString();
// Arbitrary 8-bit data stream
wxMemoryOutputStream imageStream;
if( action->GetIcon() != BITMAPS::INVALID_BITMAP )
{
wxImage image = KiBitmap( action->GetIcon() ).ConvertToImage();
image.SaveFile( imageStream, wxBitmapType::wxBITMAP_TYPE_PNG );
image.Destroy();
if( imageStream.GetSize() )
{
wxStreamBuffer* streamBuffer = imageStream.GetOutputStreamBuffer();
TDx::CImage tdxImage = TDx::CImage::FromData( "", 0, name.c_str() );
tdxImage.AssignImage( std::string( reinterpret_cast<const char*>(
streamBuffer->GetBufferStart() ),
streamBuffer->GetBufferSize() ),
0 );
wxLogTrace( m_logTrace, wxT( "Adding image for : %s" ), name );
vImages.push_back( std::move( tdxImage ) );
}
}
wxLogTrace( m_logTrace, wxT( "Inserting command: %s, description: %s, in category: %s" ),
name, description, iter->first );
iter->second->push_back(
CCommand( std::move( name ), std::move( label ), std::move( description ) ) );
}
NAV_3D::AddCommandSet( commandSet );
NAV_3D::AddImages( vImages );
}
@@ -0,0 +1,68 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file nl_footprint_properties_plugin_impl.h
* @brief declaration of the nl_footprint_properties_plugin_impl class
*/
#ifndef NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL_H_
#define NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL_H_
#include "nl_3d_viewer_plugin_impl.h"
// TDxWare SDK.
#include <SpaceMouse/CNavigation3D.hpp>
/**
* The class that adjusts NL_3D_VIEWER_PLUGIN_IMPL implementation for 3D Model preview in footprint properties dialog.
*/
class NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL : public NL_3D_VIEWER_PLUGIN_IMPL
{
public:
/**
* Initializes a new instance of the NL_FOOTPRINT_PROPERTIES_PLUGIN.
*
* @param aCanvas is the viewport to be navigated.
*/
NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas );
private:
/**
* Get Footprint 3D Model extents.
*
* @param extents is the box around the 3D model.
*/
long GetModelExtents( navlib::box_t& extents ) const override;
/**
* Export the invocable actions and images to the 3Dconnexion UI.
*/
void exportCommandsAndImages() override;
private:
/**
* Trace mask used to enable or disable the trace output of this class.
* The debug output can be turned on by setting the WXTRACE environment variable to
* "KI_TRACE_NL_FOOTPRINT_PROPERTIES_PLUGIN". See the wxWidgets documentation on wxLogTrace for
* more information.
*/
static const wxChar* m_logTrace;
};
#endif // NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL_H_
+3 -3
View File
@@ -570,6 +570,9 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
{
applySettings( cfg );
if( !GetBoard()->GetProject() )
GetBoard()->SetProject( &Prj() );
m_boardAdapter.SetBoard( GetBoard() );
// When opening the 3D viewer, we use the OpenGL mode, never the ray tracing engine
@@ -812,9 +815,6 @@ void EDA_3D_VIEWER_FRAME::loadCommonSettings()
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
const DPI_SCALING_COMMON dpi{ settings, this };
m_canvas->SetScaleFactor( dpi.GetScaleFactor() );
// TODO(JE) use all control options
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
}
+43 -11
View File
@@ -44,6 +44,8 @@
#include <eda_3d_viewer_settings.h>
#include <board_design_settings.h>
#include <3d_navlib/nl_footprint_properties_plugin.h>
PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
FOOTPRINT* aFootprint,
std::vector<FP_3DMODEL>* aParentModelList ) :
@@ -125,6 +127,9 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
OGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE::AA_8X ),
m_boardAdapter, m_currentCamera, PROJECT_PCB::Get3DCacheManager( &aFrame->Prj() ) );
m_spaceMouse = new NL_FOOTPRINT_PROPERTIES_PLUGIN( m_previewPane );
m_spaceMouse->SetFocus( true );
m_boardAdapter.SetBoard( m_dummyBoard );
m_boardAdapter.m_IsBoardView = false;
m_boardAdapter.m_IsPreviewer = true; // Force display 3D models, regardless the 3D viewer options
@@ -162,6 +167,8 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL::onUnitsChanged ),
nullptr, this );
Bind( wxCUSTOM_PANEL_SHOWN_EVENT, &PANEL_PREVIEW_3D_MODEL::onPanelShownEvent, this );
#ifdef __WXOSX__
// Call layout once to get the proper button sizes after the bitmaps have been set
Layout();
@@ -190,6 +197,7 @@ PANEL_PREVIEW_3D_MODEL::~PANEL_PREVIEW_3D_MODEL()
if( m_boardAdapter.m_Cfg )
m_boardAdapter.m_Cfg->m_Render = m_initialRender;
delete m_spaceMouse;
delete m_dummyBoard;
delete m_previewPane;
}
@@ -210,9 +218,6 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings()
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
const DPI_SCALING_COMMON dpi{ settings, this };
m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
// TODO(JE) use all control options
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
@@ -444,10 +449,15 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementScale( wxSpinEvent& event, double aSign
else if( spinCtrl == m_spinZscale )
textCtrl = zscale;
double step = SCALE_INCREMENT;
if( wxGetMouseState().ShiftDown( ) )
step = SCALE_INCREMENT_FINE;
double curr_value = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::UNSCALED,
textCtrl->GetValue() );
curr_value += ( SCALE_INCREMENT * aSign );
curr_value += ( step * aSign );
curr_value = std::max( 1/MAX_SCALE, curr_value );
curr_value = std::min( curr_value, MAX_SCALE );
@@ -465,10 +475,15 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementRotation( wxSpinEvent& aEvent, double aS
else if( spinCtrl == m_spinZrot )
textCtrl = zrot;
double step = ROTATION_INCREMENT;
if( wxGetMouseState().ShiftDown( ) )
step = ROTATION_INCREMENT_FINE;
double curr_value = EDA_UNIT_UTILS::UI::DoubleValueFromString( unityScale, EDA_UNITS::DEGREES,
textCtrl->GetValue() );
curr_value += ( ROTATION_INCREMENT * aSign );
curr_value += ( step * aSign );
curr_value = std::max( -MAX_ROTATION, curr_value );
curr_value = std::min( curr_value, MAX_ROTATION );
@@ -488,16 +503,22 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign
textCtrl = zoff;
double step_mm = OFFSET_INCREMENT_MM;
double curr_value_mm =
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, m_userUnits,
textCtrl->GetValue() )
/ pcbIUScale.IU_PER_MM;
if( wxGetMouseState().ShiftDown( ) )
step_mm = OFFSET_INCREMENT_MM_FINE;
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
{
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000;
if( wxGetMouseState().ShiftDown( ) )
step_mm = 25.4*OFFSET_INCREMENT_MIL_FINE/1000;;
}
double curr_value_mm = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, m_userUnits,
textCtrl->GetValue() )
/ pcbIUScale.IU_PER_MM;
curr_value_mm += ( step_mm * aSign );
curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
@@ -533,10 +554,10 @@ void PANEL_PREVIEW_3D_MODEL::onMouseWheelRot( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
double step = ROTATION_INCREMENT_WHEEL;
double step = ROTATION_INCREMENT;
if( event.ShiftDown( ) )
step = ROTATION_INCREMENT_WHEEL_FINE;
step = ROTATION_INCREMENT_FINE;
if( event.GetWheelRotation() >= 0 )
step = -step;
@@ -607,6 +628,17 @@ void PANEL_PREVIEW_3D_MODEL::onUnitsChanged( wxCommandEvent& aEvent )
}
void PANEL_PREVIEW_3D_MODEL::onPanelShownEvent( wxCommandEvent& aEvent )
{
if( m_spaceMouse != nullptr )
{
m_spaceMouse->SetFocus( static_cast<bool>( aEvent.GetInt() ) );
}
aEvent.Skip();
}
void PANEL_PREVIEW_3D_MODEL::UpdateDummyFootprint( bool aReloadRequired )
{
m_dummyFootprint->Models().clear();
+8 -3
View File
@@ -34,6 +34,7 @@
#include <3d_canvas/eda_3d_canvas.h>
#include <3d_viewer_id.h>
#include <3d_rendering/track_ball.h>
#include <wx/event.h>
// Define min and max parameter values
#define MAX_SCALE 10000.0
@@ -43,9 +44,8 @@
#define SCALE_INCREMENT_FINE 0.02
#define SCALE_INCREMENT 0.1
#define ROTATION_INCREMENT 90 // in degrees, for spin button command
#define ROTATION_INCREMENT_WHEEL 90 // in degrees, for mouse wheel command
#define ROTATION_INCREMENT_WHEEL_FINE 1 // in degrees, for mouse wheel command
#define ROTATION_INCREMENT 90 // in degrees
#define ROTATION_INCREMENT_FINE 1 // in degrees
#define OFFSET_INCREMENT_MM 0.5
#define OFFSET_INCREMENT_MM_FINE 0.1
@@ -53,6 +53,7 @@
#define OFFSET_INCREMENT_MIL 25.0
#define OFFSET_INCREMENT_MIL_FINE 5.0
wxDECLARE_EVENT( wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent );
// Declared classes to create pointers
class WX_INFOBAR;
@@ -61,6 +62,7 @@ class FILENAME_RESOLVER;
class BOARD;
class BOARD_ADAPTER;
class FOOTPRINT;
class NL_FOOTPRINT_PROPERTIES_PLUGIN;
class PANEL_PREVIEW_3D_MODEL: public EDA_3D_BOARD_HOLDER, public TOOLS_HOLDER, public PANEL_PREVIEW_3D_MODEL_BASE
{
@@ -140,6 +142,7 @@ private:
void doIncrementOffset( wxSpinEvent& aEvent, double aSign );
void onUnitsChanged( wxCommandEvent& aEvent );
void onPanelShownEvent( wxCommandEvent& aEvent );
wxString formatScaleValue( double aValue );
wxString formatRotationValue( double aValue );
@@ -212,6 +215,8 @@ private:
bool m_bodyStyleShowAll; /// true if the board body is show
/// The 3d viewer Render initial settings (must be saved and restored)
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS m_initialRender;
NL_FOOTPRINT_PROPERTIES_PLUGIN* m_spaceMouse;
};
#endif // PANEL_PREVIEW_3D_MODEL_H
+2 -1
View File
@@ -138,7 +138,7 @@ void IMAGE_SIZE::SetUnit( EDA_UNITS aUnit )
}
BEGIN_EVENT_TABLE( BITMAP2CMP_FRAME, EDA_BASE_FRAME )
BEGIN_EVENT_TABLE( BITMAP2CMP_FRAME, KIWAY_PLAYER )
EVT_MENU( wxID_CLOSE, BITMAP2CMP_FRAME::OnExit )
EVT_MENU( wxID_EXIT, BITMAP2CMP_FRAME::OnExit )
@@ -193,6 +193,7 @@ BITMAP2CMP_FRAME::BITMAP2CMP_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_toolManager->InitTools();
ReCreateMenuBar();
setupUIConditions();
GetSizer()->SetSizeHints( this );
+1 -1
View File
@@ -37,7 +37,7 @@ unset(_Python_NAMES)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
set(_PYTHON3_VERSIONS 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
# Disabling the "search every possible place" code for now
# see https://gitlab.com/kicad/code/kicad/-/issues/8553
+1 -1
View File
@@ -44,7 +44,7 @@ cmake_find_frameworks(Python)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
set(_PYTHON3_VERSIONS 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
if(PythonLibs_FIND_VERSION)
if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+1 -1
View File
@@ -55,7 +55,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig)
find_program(SWIG_EXECUTABLE NAMES swig4.2 swig4.1 swig4.0 swig3.0 swig2.0 swig)
if(SWIG_EXECUTABLE)
execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
+1 -1
View File
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "8.0.2" )
set( KICAD_SEMANTIC_VERSION "8.0.7" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+7
View File
@@ -109,6 +109,7 @@ static const wxChar OcePluginAngularDeflection[] = wxT( "OcePluginAngularDeflect
static const wxChar TriangulateSimplificationLevel[] = wxT( "TriangulateSimplificationLevel" );
static const wxChar TriangulateMinimumArea[] = wxT( "TriangulateMinimumArea" );
static const wxChar EnableCacheFriendlyFracture[] = wxT( "EnableCacheFriendlyFracture" );
static const wxChar MinParallelAngle[] = wxT( "MinParallelAngle" );
} // namespace KEYS
@@ -261,6 +262,8 @@ ADVANCED_CFG::ADVANCED_CFG()
m_EnableCacheFriendlyFracture = true;
m_MinParallelAngle = 0.001;
loadFromConfigFile();
}
@@ -477,6 +480,10 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_EnableCacheFriendlyFracture,
m_EnableCacheFriendlyFracture ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinParallelAngle,
&m_MinParallelAngle, m_MinParallelAngle,
0.0, 45.0 ) );
// Special case for trace mask setting...we just grab them and set them immediately
// Because we even use wxLogTrace inside of advanced config
wxString traceMasks;
+1 -1
View File
@@ -209,7 +209,7 @@ void BACKGROUND_JOB_REPORTER::AdvancePhase()
}
BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR() : m_jobListDialog( nullptr )
BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR()
{
}
+80 -18
View File
@@ -524,9 +524,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_24.png" ), 24, wxT( "light" ) );
@@ -926,9 +934,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_24.png" ), 24, wxT( "dark" ) );
@@ -1328,9 +1344,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_16.png" ), 16, wxT( "light" ) );
@@ -1730,9 +1754,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_16.png" ), 16, wxT( "dark" ) );
@@ -2132,9 +2164,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_32.png" ), 32, wxT( "light" ) );
@@ -2534,9 +2574,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_32.png" ), 32, wxT( "dark" ) );
@@ -2936,9 +2984,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_48.png" ), 48, wxT( "light" ) );
@@ -3338,9 +3394,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_48.png" ), 48, wxT( "dark" ) );
@@ -3740,9 +3804,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_64.png" ), 64, wxT( "light" ) );
@@ -4142,9 +4214,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_64.png" ), 64, wxT( "dark" ) );
@@ -4394,24 +4474,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_32].emplace_back( BITMAPS::icon_pagelayout_editor_32, wxT( "icon_pagelayout_editor_32_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_32].emplace_back( BITMAPS::icon_pcbcalculator_32, wxT( "icon_pcbcalculator_32_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_32].emplace_back( BITMAPS::icon_pcbnew_32, wxT( "icon_pcbnew_32_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb].emplace_back( BITMAPS::icon_cvpcb, wxT( "icon_cvpcb_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema].emplace_back( BITMAPS::icon_eeschema, wxT( "icon_eeschema_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview].emplace_back( BITMAPS::icon_gerbview, wxT( "icon_gerbview_64.png" ), 64, wxT( "light" ) );
+19
View File
@@ -51,6 +51,19 @@ extern std::string GetCurlLibVersion();
#include <kicad_build_version.h>
#undef INCLUDE_KICAD_VERSION
// Remember OpenGL info
static wxString s_glVendor;
static wxString s_glRenderer;
static wxString s_glVersion;
void SetOpenGLInfo( const char* aVendor, const char* aRenderer, const char* aVersion )
{
s_glVendor = wxString::FromUTF8( aVendor );
s_glRenderer = wxString::FromUTF8( aRenderer );
s_glVersion = wxString::FromUTF8( aVersion );
}
wxString GetPlatformGetBitnessName()
{
wxPlatformInfo platform;
@@ -200,6 +213,12 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
<< ", " << wxGetenv( "XDG_SESSION_TYPE" );
#endif
if( !s_glVendor.empty() || !s_glRenderer.empty() || !s_glVersion.empty() )
{
aMsg << eol;
aMsg << "OpenGL: " << s_glVendor << ", " << s_glRenderer << ", " << s_glVersion;
}
aMsg << eol << eol;
if( !aBrief )
+3
View File
@@ -162,6 +162,9 @@ void COMMIT::makeEntry( EDA_ITEM* aItem, CHANGE_TYPE aType, EDA_ITEM* aCopy, BAS
ent.m_copy = aCopy;
ent.m_screen = aScreen;
// N.B. Do not throw an assertion for multiple changed items. An item can be changed multiple times
// in a single commit such as when importing graphics and grouping them.
m_changedItems.insert( aItem );
m_changes.push_back( ent );
}
+8 -12
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2014-2020 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -147,7 +147,8 @@ wxString KIwxExpandEnvVars( const wxString& str, const PROJECT* aProject, std::s
wxString strResult;
strResult.Alloc( strlen ); // best guess (improves performance)
auto getVersionedEnvVar = []( const wxString& aMatch, wxString& aResult ) -> bool
auto getVersionedEnvVar =
[]( const wxString& aMatch, wxString& aResult ) -> bool
{
for ( const wxString& var : ENV_VAR::GetPredefinedEnvVars() )
{
@@ -180,7 +181,9 @@ wxString KIwxExpandEnvVars( const wxString& str, const PROJECT* aProject, std::s
Bracket bracket;
#ifdef __WINDOWS__
if( str_n == wxT( '%' ) )
bracket = Bracket_Windows;
{
bracket = Bracket_Windows;
}
else
#endif // __WINDOWS__
if( n == strlen - 1 )
@@ -344,18 +347,11 @@ const wxString ExpandEnvVarSubstitutions( const wxString& aString, const PROJECT
}
const wxString ResolveUriByEnvVars( const wxString& aUri, PROJECT* aProject )
const wxString ResolveUriByEnvVars( const wxString& aUri, const PROJECT* aProject )
{
wxString uri = ExpandTextVars( aUri, aProject );
// URL-like URI: return as is.
wxURL url( uri );
if( url.GetError() == wxURL_NOERR )
return uri;
// Otherwise, the path points to a local file. Resolve environment variables if any.
return ExpandEnvVarSubstitutions( aUri, aProject );
return ExpandEnvVarSubstitutions( uri, aProject );
}
+86 -51
View File
@@ -347,6 +347,24 @@ bool DATABASE_CONNECTION::SelectOne( const std::string& aTable,
return true;
}
}
else
{
wxLogTrace( traceDatabase, wxT( "SelectOne: table `%s` not in row cache; will SelectAll" ),
tableName, aWhere.second );
selectAllAndCache( tableName, aWhere.first );
if( m_cache->Get( tableName, cacheEntry ) )
{
if( cacheEntry.count( aWhere.second ) )
{
wxLogTrace( traceDatabase, wxT( "SelectOne: `%s` with parameter `%s` - cache hit" ),
tableName, aWhere.second );
aResult = cacheEntry.at( aWhere.second );
return true;
}
}
}
if( !m_columnCache.count( tableName ) )
{
@@ -372,15 +390,14 @@ bool DATABASE_CONNECTION::SelectOne( const std::string& aTable,
columnsFor( tableName ),
m_quoteChar, tableName, m_quoteChar,
m_quoteChar, columnName, m_quoteChar );
nanodbc::statement statement( *m_conn );
nanodbc::string query = fromUTF8( queryStr );
PROF_TIMER timer;
nanodbc::statement statement;
try
{
statement.prepare( query );
statement.prepare( *m_conn, query );
statement.bind( 0, aWhere.second.c_str() );
}
catch( nanodbc::database_error& e )
@@ -474,44 +491,14 @@ bool DATABASE_CONNECTION::SelectOne( const std::string& aTable,
}
bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::string& aKey,
std::vector<ROW>& aResults )
bool DATABASE_CONNECTION::selectAllAndCache( const std::string& aTable, const std::string& aKey )
{
if( !m_conn )
{
wxLogTrace( traceDatabase, wxT( "Called SelectAll without valid connection!" ) );
return false;
}
auto tableMapIter = m_tables.find( aTable );
if( tableMapIter == m_tables.end() )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: requested table %s not found in cache" ),
aTable );
return false;
}
DB_CACHE_TYPE::CACHE_VALUE cacheEntry;
if( m_cache->Get( aTable, cacheEntry ) )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s` - cache hit" ), aTable );
aResults.reserve( cacheEntry.size() );
for( auto &[ key, row ] : cacheEntry )
aResults.emplace_back( row );
return true;
}
nanodbc::statement statement( *m_conn );
nanodbc::string query = fromUTF8( fmt::format( "SELECT {} FROM {}{}{}", columnsFor( aTable ),
m_quoteChar, aTable, m_quoteChar ) );
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s`" ), toUTF8( query ) );
wxLogTrace( traceDatabase, wxT( "selectAllAndCache: `%s`" ), toUTF8( query ) );
PROF_TIMER timer;
@@ -522,7 +509,8 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
catch( nanodbc::database_error& e )
{
m_lastError = e.what();
wxLogTrace( traceDatabase, wxT( "Exception while preparing query for SelectAll: %s" ),
wxLogTrace( traceDatabase,
wxT( "Exception while preparing query for selectAllAndCache: %s" ),
m_lastError );
// Exception may be due to a connection error; nanodbc won't auto-reconnect
@@ -540,7 +528,8 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
catch( nanodbc::database_error& e )
{
m_lastError = e.what();
wxLogTrace( traceDatabase, wxT( "Exception while executing query for SelectAll: %s" ),
wxLogTrace( traceDatabase,
wxT( "Exception while executing query for selectAllAndCache: %s" ),
m_lastError );
// Exception may be due to a connection error; nanodbc won't auto-reconnect
@@ -551,15 +540,17 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
timer.Stop();
DB_CACHE_TYPE::CACHE_VALUE cacheEntry;
auto handleException =
[&]( std::runtime_error& aException, const std::string& aExtraContext = "" )
{
m_lastError = aException.what();
std::string extra = aExtraContext.empty() ? "" : ": " + aExtraContext;
wxLogTrace( traceDatabase,
wxT( "Exception while parsing result %d from SelectAll: %s%s" ),
aResults.size(), m_lastError, extra );
};
{
m_lastError = aException.what();
std::string extra = aExtraContext.empty() ? "" : ": " + aExtraContext;
wxLogTrace( traceDatabase,
wxT( "Exception while parsing result %d from selectAllAndCache: %s%s" ),
cacheEntry.size(), m_lastError, extra );
};
while( results.next() )
{
@@ -636,20 +627,64 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
}
}
aResults.emplace_back( std::move( result ) );
wxASSERT( result.count( aKey ) );
std::string keyStr = std::any_cast<std::string>( result.at( aKey ) );
cacheEntry[keyStr] = result;
}
wxLogTrace( traceDatabase, wxT( "SelectAll from %s completed in %0.1f ms" ), aTable,
wxLogTrace( traceDatabase, wxT( "selectAllAndCache from %s completed in %0.1f ms" ), aTable,
timer.msecs() );
for( const ROW& row : aResults )
m_cache->Put( aTable, cacheEntry );
return true;
}
bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::string& aKey,
std::vector<ROW>& aResults )
{
if( !m_conn )
{
wxASSERT( row.count( aKey ) );
std::string keyStr = std::any_cast<std::string>( row.at( aKey ) );
cacheEntry[keyStr] = row;
wxLogTrace( traceDatabase, wxT( "Called SelectAll without valid connection!" ) );
return false;
}
m_cache->Put( aTable, cacheEntry );
auto tableMapIter = m_tables.find( aTable );
if( tableMapIter == m_tables.end() )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: requested table %s not found in cache" ),
aTable );
return false;
}
DB_CACHE_TYPE::CACHE_VALUE cacheEntry;
if( !m_cache->Get( aTable, cacheEntry ) )
{
if( !selectAllAndCache( aTable, aKey ) )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s` cache fill failed" ), aTable );
return false;
}
// Now it should be filled
m_cache->Get( aTable, cacheEntry );
}
if( !m_cache->Get( aTable, cacheEntry ) )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s` failed to get results from cache!" ),
aTable );
return false;
}
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s` - returning cached results" ), aTable );
aResults.reserve( cacheEntry.size() );
for( auto &[ key, row ] : cacheEntry )
aResults.emplace_back( row );
return true;
}
@@ -106,6 +106,9 @@ DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) :
table.properties.exclude_from_board =
fetchOrDefault<std::string>( pj, "exclude_from_board" );
table.properties.exclude_from_sim =
fetchOrDefault<std::string>( pj, "exclude_from_sim" );
}
if( entry.contains( "fields" ) && entry["fields"].is_array() )
+33 -8
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -28,6 +28,7 @@
#include <wx/dcmemory.h>
#define ALPHA_MAX 100 // the max value returned by the alpha (opacity) slider
#define SLOPE_AXIS ( bmsize.y / 5.28 ) // was 50 at 264 size
using KIGFX::COLOR4D;
@@ -52,13 +53,17 @@ DIALOG_COLOR_PICKER::DIALOG_COLOR_PICKER( wxWindow* aParent, const COLOR4D& aCur
m_allowOpacityCtrl = aAllowOpacityControl;
m_previousColor4D = aCurrentColor;
m_newColor4D = aCurrentColor;
m_cursorsSize = 8; // Size of square cursors drawn on color bitmaps
m_newColor4D.ToHSV( m_hue, m_sat, m_val, true );
m_bitmapRGB = nullptr;
m_bitmapHSV = nullptr;
m_selectedCursor = nullptr;
m_defaultColor = aDefaultColor;
updateHandleSize();
m_OldColorRect->SetMinSize( FromDIP( wxSize( 24, 24 ) ) );
m_NewColorRect->SetMinSize( FromDIP( wxSize( 24, 24 ) ) );
if( !m_allowOpacityCtrl )
{
m_SizerTransparency->Show( false );
@@ -121,16 +126,15 @@ void DIALOG_COLOR_PICKER::updatePreview( wxStaticBitmap* aStaticBitmap, COLOR4D&
wxBitmap newBm = COLOR_SWATCH::MakeBitmap( aColor4D, COLOR4D::WHITE, aStaticBitmap->GetSize(),
ConvertDialogToPixels( CHECKERBOARD_SIZE_DU ),
aStaticBitmap->GetParent()->GetBackgroundColour() );
newBm.SetScaleFactor( GetDPIScaleFactor() );
aStaticBitmap->SetBitmap( newBm );
}
bool DIALOG_COLOR_PICKER::TransferDataToWindow()
{
// Draw all bitmaps, with colors according to the color 4D
updatePreview( m_OldColorRect, m_previousColor4D );
SetEditVals( ALL_CHANGED, false );
drawAll();
// Configure the spin control sizes
configureSpinCtrl( m_spinCtrlGreen );
@@ -144,6 +148,10 @@ bool DIALOG_COLOR_PICKER::TransferDataToWindow()
finishDialogSettings();
// Draw all bitmaps, with colors according to the color 4D
updatePreview( m_OldColorRect, m_previousColor4D );
drawAll();
return true;
}
@@ -171,6 +179,8 @@ void DIALOG_COLOR_PICKER::initDefinedColors( CUSTOM_COLORS_LIST* aPredefinedColo
{
wxBitmap bm = COLOR_SWATCH::MakeBitmap( aColor, COLOR4D::WHITE, swatchSize,
checkerboardSize, checkboardBackground );
bm.SetScaleFactor( GetDPIScaleFactor() );
wxStaticBitmap* swatch = new wxStaticBitmap( m_panelDefinedColors, aId, bm );
m_fgridColor->Add( swatch, 0, wxALIGN_CENTER_VERTICAL, 5 );
@@ -245,7 +255,6 @@ void DIALOG_COLOR_PICKER::createRGBBitmap()
// Red blue area in X Z 3d axis
double inc = 255.0 / half_size;
#define SLOPE_AXIS 50.0
double slope = SLOPE_AXIS/half_size;
color.g = 0.0;
@@ -315,6 +324,7 @@ void DIALOG_COLOR_PICKER::createRGBBitmap()
delete m_bitmapRGB;
m_bitmapRGB = new wxBitmap( img, 24 );
m_bitmapRGB->SetScaleFactor( m_RgbBitmap->GetDPIScaleFactor() );
m_RgbBitmap->SetBitmap( *m_bitmapRGB );
}
@@ -379,6 +389,7 @@ void DIALOG_COLOR_PICKER::createHSVBitmap()
delete m_bitmapHSV;
m_bitmapHSV = new wxBitmap( img, 24 );
m_bitmapHSV->SetScaleFactor( m_HsvBitmap->GetDPIScaleFactor() );
m_HsvBitmap->SetBitmap( *m_bitmapHSV );
}
@@ -413,8 +424,7 @@ void DIALOG_COLOR_PICKER::drawRGBPalette()
bitmapDC.SetBrush( brush );
int half_csize = m_cursorsSize / 2;
#define SLOPE_AXIS 50.0
double slope = SLOPE_AXIS / half_size;
double slope = SLOPE_AXIS / ( half_size );
// Red axis cursor (Z 3Daxis):
m_cursorBitmapRed.x = 0;
@@ -539,8 +549,15 @@ void DIALOG_COLOR_PICKER::SetEditVals( CHANGED_COLOR aChanged, bool aCheckTransp
}
void DIALOG_COLOR_PICKER::updateHandleSize()
{
m_cursorsSize = FromDIP( 8 ); // Size of square cursors drawn on color bitmaps
}
void DIALOG_COLOR_PICKER::drawAll()
{
updateHandleSize();
m_NewColorRect->Freeze(); // Avoid flicker
m_HsvBitmap->Freeze();
m_RgbBitmap->Freeze();
@@ -699,6 +716,14 @@ void DIALOG_COLOR_PICKER::onHSVMouseDrag( wxMouseEvent& event )
}
void DIALOG_COLOR_PICKER::onSize( wxSizeEvent& event )
{
drawAll();
event.Skip();
}
void DIALOG_COLOR_PICKER::OnColorValueText( wxCommandEvent& event )
{
if( m_newColor4D.SetFromHexString( m_colorValue->GetValue() ) )
+25 -29
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.1.0-0-g733bf3d)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -33,7 +33,10 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
m_RgbBitmap = new wxStaticBitmap( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 );
m_RgbBitmap->SetMinSize( wxSize( 264,264 ) );
sbSizerViewRGB->Add( m_RgbBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
sbSizerViewRGB->Add( m_RgbBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND|wxSHAPED, 5 );
sbSizerViewRGB->Add( 0, 0, 1, wxEXPAND, 5 );
wxFlexGridSizer* fgSizerRGB;
fgSizerRGB = new wxFlexGridSizer( 0, 3, 0, 0 );
@@ -68,18 +71,18 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
sbSizerViewRGB->Add( fgSizerRGB, 0, wxEXPAND, 5 );
bSizerPanels->Add( sbSizerViewRGB, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerPanels->Add( sbSizerViewRGB, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
wxStaticBoxSizer* sbSizerViewHSV;
sbSizerViewHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, _("HSV") ), wxHORIZONTAL );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxVERTICAL );
sbSizerViewHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, _("HSV") ), wxVERTICAL );
m_HsvBitmap = new wxStaticBitmap( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 );
m_HsvBitmap->SetMinSize( wxSize( 264,264 ) );
bSizer10->Add( m_HsvBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
sbSizerViewHSV->Add( m_HsvBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND|wxSHAPED, 5 );
sbSizerViewHSV->Add( 0, 0, 1, wxEXPAND, 5 );
wxFlexGridSizer* fgSizerHSV;
fgSizerHSV = new wxFlexGridSizer( 0, 2, 0, 0 );
@@ -103,26 +106,23 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
fgSizerHSV->Add( m_spinCtrlSaturation, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizer10->Add( fgSizerHSV, 0, wxEXPAND, 5 );
sbSizerViewHSV->Add( fgSizerHSV, 0, wxEXPAND, 5 );
sbSizerViewHSV->Add( bSizer10, 0, wxEXPAND, 5 );
bSizerPanels->Add( sbSizerViewHSV, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerBright;
bSizerBright = new wxBoxSizer( wxVERTICAL );
m_staticTextBright = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, _("Value:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBright = new wxStaticText( m_panelFreeColors, wxID_ANY, _("Value:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBright->Wrap( -1 );
bSizerBright->Add( m_staticTextBright, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_sliderBrightness = new wxSlider( sbSizerViewHSV->GetStaticBox(), wxID_ANY, 255, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_INVERSE|wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
m_sliderBrightness = new wxSlider( m_panelFreeColors, wxID_ANY, 255, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_INVERSE|wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
bSizerBright->Add( m_sliderBrightness, 1, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5 );
sbSizerViewHSV->Add( bSizerBright, 0, wxEXPAND, 5 );
bSizerPanels->Add( sbSizerViewHSV, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
bSizerPanels->Add( bSizerBright, 0, wxALL|wxEXPAND, 5 );
bSizerUpperFreeColors->Add( bSizerPanels, 1, wxEXPAND, 5 );
@@ -153,7 +153,7 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
m_SizerDefinedColors->Fit( m_panelDefinedColors );
m_notebook->AddPage( m_panelDefinedColors, _("Defined Colors"), false );
bSizerUpperMain->Add( m_notebook, 0, wxEXPAND | wxALL, 5 );
bSizerUpperMain->Add( m_notebook, 1, wxEXPAND | wxALL, 5 );
m_SizerTransparency = new wxBoxSizer( wxVERTICAL );
@@ -171,35 +171,29 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
bSizerUpperMain->Add( m_SizerTransparency, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bSizerUpperMain->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bSizerMain->Add( bSizerUpperMain, 0, wxEXPAND, 5 );
bSizerMain->Add( bSizerUpperMain, 1, wxEXPAND, 5 );
wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
m_staticTextOldColor = new wxStaticText( this, wxID_ANY, _("Preview (old/new):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextOldColor->Wrap( -1 );
bButtonsSizer->Add( m_staticTextOldColor, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
bButtonsSizer->Add( m_staticTextOldColor, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_OldColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
m_OldColorRect->SetMinSize( wxSize( 24,24 ) );
bButtonsSizer->Add( m_OldColorRect, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
bButtonsSizer->Add( m_OldColorRect, 0, wxALIGN_CENTER_VERTICAL|wxSHAPED, 5 );
m_NewColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
m_NewColorRect->SetMinSize( wxSize( 24,24 ) );
bButtonsSizer->Add( m_NewColorRect, 0, wxALIGN_CENTER_VERTICAL, 5 );
bButtonsSizer->Add( 10, 0, 0, wxEXPAND, 5 );
bButtonsSizer->Add( m_NewColorRect, 0, wxALIGN_CENTER_VERTICAL|wxSHAPED, 5 );
m_colorValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_colorValue->SetMinSize( wxSize( 176,-1 ) );
bButtonsSizer->Add( m_colorValue, 0, wxALIGN_CENTER_VERTICAL, 5 );
bButtonsSizer->Add( m_colorValue, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
bButtonsSizer->Add( 20, 0, 0, wxEXPAND, 5 );
@@ -217,7 +211,7 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
bButtonsSizer->Add( m_sdbSizer, 1, wxALL, 5 );
bSizerMain->Add( bButtonsSizer, 1, wxEXPAND|wxLEFT, 10 );
bSizerMain->Add( bButtonsSizer, 0, wxEXPAND|wxLEFT, 10 );
this->SetSizer( bSizerMain );
@@ -234,6 +228,7 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
m_spinCtrlBlue->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditBlue ), NULL, this );
m_HsvBitmap->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onHSVMouseClick ), NULL, this );
m_HsvBitmap->Connect( wxEVT_MOTION, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onHSVMouseDrag ), NULL, this );
m_HsvBitmap->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_COLOR_PICKER_BASE::onSize ), NULL, this );
m_spinCtrlHue->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditHue ), NULL, this );
m_spinCtrlSaturation->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditSat ), NULL, this );
m_sliderBrightness->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeBrightness ), NULL, this );
@@ -268,6 +263,7 @@ DIALOG_COLOR_PICKER_BASE::~DIALOG_COLOR_PICKER_BASE()
m_spinCtrlBlue->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditBlue ), NULL, this );
m_HsvBitmap->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onHSVMouseClick ), NULL, this );
m_HsvBitmap->Disconnect( wxEVT_MOTION, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onHSVMouseDrag ), NULL, this );
m_HsvBitmap->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_COLOR_PICKER_BASE::onSize ), NULL, this );
m_spinCtrlHue->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditHue ), NULL, this );
m_spinCtrlSaturation->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditSat ), NULL, this );
m_sliderBrightness->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeBrightness ), NULL, this );
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.1.0-0-g733bf3d)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -81,6 +81,7 @@ class DIALOG_COLOR_PICKER_BASE : public DIALOG_SHIM
virtual void OnChangeEditBlue( wxSpinEvent& event ) { event.Skip(); }
virtual void onHSVMouseClick( wxMouseEvent& event ) { event.Skip(); }
virtual void onHSVMouseDrag( wxMouseEvent& event ) { event.Skip(); }
virtual void onSize( wxSizeEvent& event ) { event.Skip(); }
virtual void OnChangeEditHue( wxSpinEvent& event ) { event.Skip(); }
virtual void OnChangeEditSat( wxSpinEvent& event ) { event.Skip(); }
virtual void OnChangeBrightness( wxScrollEvent& event ) { event.Skip(); }
@@ -34,6 +34,7 @@
#include <pgm_base.h>
#include <widgets/wx_grid.h>
#include <widgets/grid_text_button_helpers.h>
#include <widgets/grid_text_helpers.h>
#include <widgets/std_bitmap_button.h>
#include <algorithm>
@@ -49,7 +49,7 @@ DIALOG_CONFIGURE_PATHS_BASE::DIALOG_CONFIGURE_PATHS_BASE( wxWindow* parent, wxWi
// Label Appearance
// Cell Defaults
m_EnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_EnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
m_EnvVars->SetMinSize( wxSize( 604,170 ) );
sbEnvVars->Add( m_EnvVars, 1, wxALL|wxEXPAND, 5 );
@@ -70,7 +70,7 @@ DIALOG_CONFIGURE_PATHS_BASE::DIALOG_CONFIGURE_PATHS_BASE( wxWindow* parent, wxWi
sbEnvVars->Add( bSizerEnvVarBtns, 0, wxEXPAND, 5 );
bSizerMain->Add( sbEnvVars, 1, wxEXPAND|wxALL, 5 );
bSizerMain->Add( sbEnvVars, 1, wxALL|wxEXPAND, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
+210 -254
View File
@@ -62,109 +62,23 @@
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="col_label_size">wxGRID_AUTOSIZE</property>
<property name="col_label_values">&quot;Environment Variables&quot; &quot;Path&quot; &quot;&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">2</property>
<property name="column_sizes">150,454</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">1</property>
<property name="editing">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">604,170</property>
<property name="moveable">1</property>
<property name="name">m_EnvVars</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="row_label_size">0</property>
<property name="row_label_values"></property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes"></property>
<property name="rows">1</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnSize">OnGridSize</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Environment Variables</property>
<property name="minimum_size"></property>
<property name="name">bSizerEnvVarBtns</property>
<property name="orient">wxHORIZONTAL</property>
<property name="name">sbEnvVars</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -173,209 +87,251 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="col_label_size">wxGRID_AUTOSIZE</property>
<property name="col_label_values">&quot;Name&quot; &quot;Path&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">2</property>
<property name="column_sizes">150,454</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">1</property>
<property name="editing">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Add Environment Variable</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
<property name="minimum_size">604,170</property>
<property name="moveable">1</property>
<property name="name">m_btnAddEnvVar</property>
<property name="name">m_EnvVars</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="row_label_size">0</property>
<property name="row_label_values"></property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes"></property>
<property name="rows">1</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnAddEnvVar</event>
<event name="OnSize">OnGridSize</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerEnvVarBtns</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Add Environment Variable</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_btnAddEnvVar</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnAddEnvVar</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Delete Environment Variable</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_btnDeleteEnvVar</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnRemoveEnvVar</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Delete Environment Variable</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_btnDeleteEnvVar</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnRemoveEnvVar</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticline1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -43,6 +43,9 @@ void DIALOG_EDIT_LIBRARY_TABLES::InstallPanel( wxPanel* aPanel )
auto mainSizer = new wxBoxSizer( wxVERTICAL );
SetSizer( mainSizer );
m_infoBar = new WX_INFOBAR( this );
mainSizer->Add( m_infoBar, 0, wxEXPAND, 0 );
mainSizer->Add( m_contentPanel, 1, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 5 );
m_contentPanel->SetMinSize( FromDIP( wxSize( 1000, 600 ) ) );
+3 -6
View File
@@ -442,14 +442,11 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
wxString netclass = m_assignmentGrid->GetCellValue( row, 1 );
m_netSettings->m_NetClassPatternAssignments.push_back(
{
std::make_unique<EDA_COMBINED_MATCHER>( pattern, CTX_NETCLASS ),
netclass
} );
m_netSettings->m_NetClassPatternAssignmentCache.clear();
{ std::make_unique<EDA_COMBINED_MATCHER>( pattern, CTX_NETCLASS ), netclass } );
}
m_netSettings->m_NetClassPatternAssignmentCache.clear();
return true;
}
+1
View File
@@ -29,6 +29,7 @@
#include <project.h>
#include <grid_tricks.h>
#include <widgets/std_bitmap_button.h>
#include <widgets/grid_text_helpers.h>
#include <algorithm>
+15 -2
View File
@@ -648,8 +648,21 @@ void EDA_DRAW_PANEL_GAL::onShowTimer( wxTimerEvent& aEvent )
void EDA_DRAW_PANEL_GAL::SetCurrentCursor( KICURSOR aCursor )
{
if( m_gal )
m_gal->SetNativeCursorStyle( aCursor );
if( !m_gal )
return;
DPI_SCALING_COMMON dpi( nullptr, m_parent );
bool hidpi = false;
// Cursor scaling factor cannot be set for a wxCursor on GTK and OSX (at least before wx 3.3),
// resulting in 4x rendered size on 2x window scale.
// MSW renders the bitmap as-is, without scaling, so this works here.
#ifdef __WXMSW__
hidpi = dpi.GetContentScaleFactor() >= 2.0;
#endif
m_gal->SetNativeCursorStyle( aCursor, hidpi );
}
+29
View File
@@ -681,6 +681,35 @@ void DS_DATA_ITEM_TEXT::SetConstrainedTextSize()
if( m_ConstrainedTextSize.y == 0 )
m_ConstrainedTextSize.y = DS_DATA_MODEL::GetTheInstance().m_DefaultTextSize.y;
if( m_BoundingBoxSize.x > 0 || m_BoundingBoxSize.y > 0 )
{
// to know the X and Y size of the line, we should use EDA_TEXT::GetTextBox()
// but this function uses integers
// So, to avoid truncations with our unit in mm, use microns.
VECTOR2I size_micron;
#define FSCALE 1000.0
int linewidth = 0;
size_micron.x = KiROUND( m_ConstrainedTextSize.x * FSCALE );
size_micron.y = KiROUND( m_ConstrainedTextSize.y * FSCALE );
DS_DRAW_ITEM_TEXT dummy( unityScale, this, 0, m_FullText, VECTOR2I( 0, 0 ), size_micron,
linewidth, m_Font, m_Italic, m_Bold, m_TextColor );
dummy.SetMultilineAllowed( true );
dummy.SetHorizJustify( m_Hjustify ) ;
dummy.SetVertJustify( m_Vjustify );
dummy.SetTextAngle( EDA_ANGLE( m_Orient, DEGREES_T ) );
BOX2I rect = dummy.GetTextBox();
VECTOR2D size;
size.x = KiROUND( (int) rect.GetWidth() / FSCALE );
size.y = KiROUND( (int) rect.GetHeight() / FSCALE );
if( m_BoundingBoxSize.x > 0 && size.x > m_BoundingBoxSize.x )
m_ConstrainedTextSize.x *= m_BoundingBoxSize.x / size.x;
if( m_BoundingBoxSize.y > 0 && size.y > m_BoundingBoxSize.y )
m_ConstrainedTextSize.y *= m_BoundingBoxSize.y / size.y;
}
}
+1 -1
View File
@@ -279,7 +279,7 @@ void KIGFX::DS_PAINTER::draw( const DS_DRAW_ITEM_TEXT* aItem, int aLayer ) const
if( !font )
{
font = KIFONT::FONT::GetFont( m_renderSettings.GetDefaultFont(), aItem->IsBold(),
aItem->IsItalic() );
aItem->IsItalic(), true );
}
const COLOR4D& color = m_renderSettings.GetColor( aItem, aLayer );
+4
View File
@@ -265,6 +265,10 @@ void EDA_BASE_FRAME::windowClosing( wxCloseEvent& event )
EDA_BASE_FRAME::~EDA_BASE_FRAME()
{
Disconnect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER,
wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) );
Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EDA_BASE_FRAME::windowClosing ) );
delete m_autoSaveTimer;
delete m_fileHistory;
+13 -7
View File
@@ -401,8 +401,6 @@ void EDA_SHAPE::flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
m_start.y = aCentre.y - ( m_start.y - aCentre.y );
m_end.y = aCentre.y - ( m_end.y - aCentre.y );
}
std::swap( m_start, m_end );
break;
case SHAPE_T::CIRCLE:
@@ -1991,13 +1989,13 @@ static struct EDA_SHAPE_DESC
.SetAvailableFunc( isNotPolygonOrCircle );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Center X" ),
&EDA_SHAPE::SetStartX, &EDA_SHAPE::GetStartX, PROPERTY_DISPLAY::PT_COORD,
&EDA_SHAPE::SetCenterX, &EDA_SHAPE::GetStartX, PROPERTY_DISPLAY::PT_COORD,
ORIGIN_TRANSFORMS::ABS_X_COORD ),
shapeProps )
.SetAvailableFunc( isCircle );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Center Y" ),
&EDA_SHAPE::SetStartY, &EDA_SHAPE::GetStartY, PROPERTY_DISPLAY::PT_COORD,
&EDA_SHAPE::SetCenterY, &EDA_SHAPE::GetStartY, PROPERTY_DISPLAY::PT_COORD,
ORIGIN_TRANSFORMS::ABS_Y_COORD ),
shapeProps )
.SetAvailableFunc( isCircle );
@@ -2072,9 +2070,17 @@ static struct EDA_SHAPE_DESC
shapeProps )
.SetAvailableFunc( fillAvailable );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, COLOR4D>( _HKI( "Fill Color" ),
&EDA_SHAPE::SetFillColor, &EDA_SHAPE::GetFillColor ),
shapeProps )
auto fillColor = new PROPERTY<EDA_SHAPE, COLOR4D>( _HKI( "Fill Color" ),
&EDA_SHAPE::SetFillColor, &EDA_SHAPE::GetFillColor );
fillColor->SetWriteableFunc(
[=]( INSPECTABLE* aItem ) -> bool
{
if( EDA_SHAPE* edaShape = dynamic_cast<EDA_SHAPE*>( aItem ) )
return edaShape->GetFillMode() == FILL_T::FILLED_WITH_COLOR;
return true;
} );
propMgr.AddProperty( fillColor, shapeProps )
.SetAvailableFunc( fillAvailable )
.SetIsHiddenFromRulesEditor();
}
+70 -3
View File
@@ -48,6 +48,7 @@
#include <font/outline_font.h>
#include <geometry/shape_poly_set.h>
#include <properties/property_validators.h>
#include <ctl_flags.h> // for CTL_OMIT_HIDE definition
#include <wx/debug.h> // for wxASSERT
#include <wx/string.h>
@@ -211,6 +212,26 @@ void EDA_TEXT::SetTextAngle( const EDA_ANGLE& aAngle )
void EDA_TEXT::SetItalic( bool aItalic )
{
if( m_attributes.m_Italic != aItalic )
{
const KIFONT::FONT* font = GetFont();
if( !font || font->IsStroke() )
{
// For stroke fonts, just need to set the attribute.
}
else
{
// For outline fonts, italic-ness is determined by the font itself.
SetFont( KIFONT::FONT::GetFont( font->GetName(), IsBold(), aItalic ) );
}
}
SetItalicFlag( aItalic );
}
void EDA_TEXT::SetItalicFlag( bool aItalic )
{
m_attributes.m_Italic = aItalic;
ClearRenderCache();
@@ -219,6 +240,48 @@ void EDA_TEXT::SetItalic( bool aItalic )
void EDA_TEXT::SetBold( bool aBold )
{
if( m_attributes.m_Bold != aBold )
{
const KIFONT::FONT* font = GetFont();
if( !font || font->IsStroke() )
{
// For stroke fonts, boldness is determined by the pen size.
const int size = std::min( m_attributes.m_Size.x, m_attributes.m_Size.y );
if( aBold )
{
m_attributes.m_StoredStrokeWidth = m_attributes.m_StrokeWidth;
m_attributes.m_StrokeWidth = GetPenSizeForBold( size );
}
else
{
// Restore the original stroke width from `m_StoredStrokeWidth` if it was previously stored,
// resetting the width after unbolding.
if( m_attributes.m_StoredStrokeWidth )
m_attributes.m_StrokeWidth = m_attributes.m_StoredStrokeWidth;
else
{
m_attributes.m_StrokeWidth = GetPenSizeForNormal( size );
// Sets `m_StrokeWidth` to the normal pen size and stores it in `m_StoredStrokeWidth`
// as the default, but only if the bold option was applied before this feature was implemented.
m_attributes.m_StoredStrokeWidth = m_attributes.m_StrokeWidth;
}
}
}
else
{
// For outline fonts, boldness is determined by the font itself.
SetFont( KIFONT::FONT::GetFont( font->GetName(), aBold, IsItalic() ) );
}
}
SetBoldFlag( aBold );
}
void EDA_TEXT::SetBoldFlag( bool aBold )
{
m_attributes.m_Bold = aBold;
ClearRenderCache();
@@ -528,10 +591,13 @@ EDA_TEXT::GetRenderCache( const KIFONT::FONT* aFont, const wxString& forResolved
}
void EDA_TEXT::SetupRenderCache( const wxString& aResolvedText, const EDA_ANGLE& aAngle )
void EDA_TEXT::SetupRenderCache( const wxString& aResolvedText, const KIFONT::FONT* aFont,
const EDA_ANGLE& aAngle, const VECTOR2I& aOffset )
{
m_render_cache_text = aResolvedText;
m_render_cache_font = aFont;
m_render_cache_angle = aAngle;
m_render_cache_offset = aOffset;
m_render_cache.clear();
}
@@ -539,6 +605,7 @@ void EDA_TEXT::SetupRenderCache( const wxString& aResolvedText, const EDA_ANGLE&
void EDA_TEXT::AddRenderCacheGlyph( const SHAPE_POLY_SET& aPoly )
{
m_render_cache.emplace_back( std::make_unique<KIFONT::OUTLINE_GLYPH>( aPoly ) );
static_cast<KIFONT::OUTLINE_GLYPH*>( m_render_cache.back().get() )->CacheTriangulation();
}
@@ -914,7 +981,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
if( IsItalic() )
aFormatter->Print( 0, " (italic yes)" );
if( GetTextColor() != COLOR4D::UNSPECIFIED )
if( !( aControlBits & CTL_OMIT_COLOR ) && GetTextColor() != COLOR4D::UNSPECIFIED )
{
aFormatter->Print( 0, " (color %d %d %d %s)",
KiROUND( GetTextColor().r * 255.0 ),
@@ -945,7 +1012,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
if( !( aControlBits & CTL_OMIT_HIDE ) && !IsVisible() )
aFormatter->Print( 0, " (hide yes)" );
if( HasHyperlink() )
if( !( aControlBits & CTL_OMIT_HYPERLINK ) && HasHyperlink() )
{
aFormatter->Print( 0, " (href %s)", aFormatter->Quotew( GetHyperlink() ).c_str() );
}
+5 -4
View File
@@ -57,7 +57,7 @@ const METRICS& METRICS::Default()
FONT* FONT::s_defaultFont = nullptr;
std::map< std::tuple<wxString, bool, bool>, FONT*> FONT::s_fontMap;
std::map< std::tuple<wxString, bool, bool, bool>, FONT*> FONT::s_fontMap;
class MARKUP_CACHE
{
@@ -143,12 +143,13 @@ FONT* FONT::getDefaultFont()
}
FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic )
FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic,
bool aForDrawingSheet )
{
if( aFontName.empty() || aFontName.StartsWith( KICAD_FONT_NAME ) )
return getDefaultFont();
std::tuple<wxString, bool, bool> key = { aFontName, aBold, aItalic };
std::tuple<wxString, bool, bool, bool> key = { aFontName, aBold, aItalic, aForDrawingSheet };
FONT* font = nullptr;
@@ -156,7 +157,7 @@ FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic )
font = s_fontMap[key];
if( !font )
font = OUTLINE_FONT::LoadFont( aFontName, aBold, aItalic );
font = OUTLINE_FONT::LoadFont( aFontName, aBold, aItalic, aForDrawingSheet );
if( !font )
font = getDefaultFont();
+28 -2
View File
@@ -26,6 +26,7 @@
#include <string_utils.h>
#include <macros.h>
#include <cstdint>
#include <reporter.h>
#ifdef __WIN32__
#define WIN32_LEAN_AND_MEAN
@@ -37,6 +38,8 @@ using namespace fontconfig;
static FONTCONFIG* g_config = nullptr;
static bool g_fcInitSuccess = false;
REPORTER* FONTCONFIG::s_reporter = nullptr;
/**
* A simple wrapper to avoid exporing fontconfig in the header
*/
@@ -57,6 +60,12 @@ FONTCONFIG::FONTCONFIG()
};
void fontconfig::FONTCONFIG::SetReporter( REPORTER* aReporter )
{
s_reporter = aReporter;
}
/**
* This is simply a wrapper to call FcInit() with SEH for Windows
* SEH on Windows can only be used in functions without objects that might be unwinded
@@ -195,6 +204,17 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString
if( !g_fcInitSuccess )
return retval;
// If the original font name contains any of these, then it is bold, regardless
// of whether we are looking for bold or not
if( aFontName.Lower().Contains( wxS( "bold" ) ) // also catches ultrabold
|| aFontName.Lower().Contains( wxS( "heavy" ) )
|| aFontName.Lower().Contains( wxS( "black" ) ) // also catches extrablack
|| aFontName.Lower().Contains( wxS( "thick" ) )
|| aFontName.Lower().Contains( wxS( "dark" ) ) )
{
aBold = true;
}
wxString qualifiedFontName = aFontName;
wxScopedCharBuffer const fcBuffer = qualifiedFontName.ToUTF8();
@@ -317,12 +337,18 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString
if( retval == FF_RESULT::FF_ERROR )
{
wxLogWarning( _( "Error loading font '%s'." ), qualifiedFontName );
if( s_reporter )
s_reporter->Report( wxString::Format( _( "Error loading font '%s'." ), qualifiedFontName ) );
}
else if( retval == FF_RESULT::FF_SUBSTITUTE )
{
fontName.Replace( ':', ' ' );
wxLogWarning( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName );
// If we missed a case but the matching found the original font name, then we are not substituting
if( fontName.CmpNoCase( qualifiedFontName ) == 0 )
retval = FF_RESULT::FF_OK;
else if( s_reporter )
s_reporter->Report( wxString::Format( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName ) );
}
FcPatternDestroy( pat );
+33 -10
View File
@@ -44,7 +44,8 @@ OUTLINE_FONT::OUTLINE_FONT() :
m_face(NULL),
m_faceSize( 16 ),
m_fakeBold( false ),
m_fakeItal( false )
m_fakeItal( false ),
m_forDrawingSheet( false )
{
std::lock_guard<std::mutex> guard( m_freeTypeMutex );
@@ -53,7 +54,8 @@ OUTLINE_FONT::OUTLINE_FONT() :
}
OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, bool aItalic )
OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, bool aItalic,
bool aForDrawingSheet )
{
std::unique_ptr<OUTLINE_FONT> font = std::make_unique<OUTLINE_FONT>();
@@ -77,6 +79,7 @@ OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, boo
font->m_fontName = aFontName; // Keep asked-for name, even if we substituted.
font->m_fontFileName = fontFile;
font->m_forDrawingSheet = aForDrawingSheet;
return font.release();
}
@@ -259,6 +262,8 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphs( BOX2I* aBBox, std::vector<std::unique_pt
struct GLYPH_CACHE_KEY {
FT_Face face;
hb_codepoint_t codepoint;
double scaler;
bool forDrawingSheet;
bool fakeItalic;
bool fakeBold;
bool mirror;
@@ -266,9 +271,14 @@ struct GLYPH_CACHE_KEY {
bool operator==(const GLYPH_CACHE_KEY& rhs ) const
{
return face == rhs.face && codepoint == rhs.codepoint
&& fakeItalic == rhs.fakeItalic && fakeBold == rhs.fakeBold
&& mirror == rhs.mirror && angle == rhs.angle;
return face == rhs.face
&& codepoint == rhs.codepoint
&& scaler == rhs.scaler
&& forDrawingSheet == rhs.forDrawingSheet
&& fakeItalic == rhs.fakeItalic
&& fakeBold == rhs.fakeBold
&& mirror == rhs.mirror
&& angle == rhs.angle;
}
};
@@ -279,9 +289,14 @@ namespace std
{
std::size_t operator()( const GLYPH_CACHE_KEY& k ) const
{
return hash<const void*>()( k.face ) ^ hash<unsigned>()( k.codepoint )
^ hash<int>()( k.fakeItalic ) ^ hash<int>()( k.fakeBold )
^ hash<int>()( k.mirror ) ^ hash<int>()( k.angle.AsTenthsOfADegree() );
return hash<const void*>()( k.face )
^ hash<unsigned>()( k.codepoint )
^ hash<double>()( k.scaler )
^ hash<double>()( k.forDrawingSheet )
^ hash<int>()( k.fakeItalic )
^ hash<int>()( k.fakeBold )
^ hash<int>()( k.mirror )
^ hash<int>()( k.angle.AsTenthsOfADegree() );
}
};
}
@@ -339,8 +354,8 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphsUnlocked( BOX2I* aBBox,
if( aGlyphs )
{
GLYPH_CACHE_KEY key = { face, glyphInfo[i].codepoint, m_fakeItal, m_fakeBold,
aMirror, aAngle };
GLYPH_CACHE_KEY key = { face, glyphInfo[i].codepoint, scaler, m_forDrawingSheet,
m_fakeItal, m_fakeBold, aMirror, aAngle };
GLYPH_DATA& glyphData = s_glyphCache[ key ];
if( glyphData.m_Contours.empty() )
@@ -437,6 +452,8 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphsUnlocked( BOX2I* aBBox,
for( SHAPE_LINE_CHAIN& hole : holes )
{
bool added_hole = false;
if( hole.PointCount() )
{
for( int ii = 0; ii < glyph->OutlineCount(); ++ii )
@@ -444,9 +461,15 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphsUnlocked( BOX2I* aBBox,
if( glyph->Outline( ii ).PointInside( hole.GetPoint( 0 ) ) )
{
glyph->AddHole( std::move( hole ), ii );
added_hole = true;
break;
}
}
// Some lovely TTF fonts decided that winding didn't matter for outlines that
// don't have holes, so holes that don't fit in any outline are added as outlines
if( !added_hole )
glyph->AddOutline( std::move( hole ) );
}
}
+2 -1
View File
@@ -35,7 +35,8 @@ TEXT_ATTRIBUTES::TEXT_ATTRIBUTES( KIFONT::FONT* aFont ) :
m_Visible( true ),
m_Mirrored( false ),
m_Multiline( true ),
m_KeepUpright( false )
m_KeepUpright( false ),
m_StoredStrokeWidth( 0 )
{
}
+22 -26
View File
@@ -190,7 +190,7 @@ static double roundp( double x )
const VECTOR2D CAIRO_GAL_BASE::roundp( const VECTOR2D& v )
{
if( m_lineWidthIsOdd && m_isStrokeEnabled )
if( m_lineWidthIsOdd )
return VECTOR2D( ::roundp( v.x ), ::roundp( v.y ) );
else
return VECTOR2D( floor( v.x + 0.5 ), floor( v.y + 0.5 ) );
@@ -352,13 +352,18 @@ void CAIRO_GAL_BASE::DrawArc( const VECTOR2D& aCenterPoint, double aRadius,
double r = xform( aRadius );
// N.B. This is backwards. We set this because we want to adjust the center
// point that changes both endpoints. In the worst case, this is twice as far.
// We cannot adjust radius or center based on the other because this causes the
// whole arc to change position/size
m_lineWidthIsOdd = !( static_cast<int>( aRadius ) % 2 );
// Adjust center and radius slightly to better match the rounding of endpoints.
VECTOR2D mid = roundp( xform( aCenterPoint ) );
auto mid = roundp( xform( aCenterPoint ) );
VECTOR2D startPointS = VECTOR2D( r, 0.0 );
VECTOR2D endPointS = VECTOR2D( r, 0.0 );
RotatePoint( startPointS, -EDA_ANGLE( startAngle, RADIANS_T ) );
RotatePoint( endPointS, -EDA_ANGLE( endAngle, RADIANS_T ) );
VECTOR2D refStart = roundp( xform( aCenterPoint ) + startPointS );
VECTOR2D refEnd = roundp( xform( aCenterPoint ) + endPointS );
r = ( ( refStart - mid ).EuclideanNorm() + ( refEnd - mid ).EuclideanNorm() ) / 2.0;
cairo_set_line_width( m_currentContext, m_lineWidthInPixels );
cairo_new_sub_path( m_currentContext );
@@ -403,13 +408,7 @@ void CAIRO_GAL_BASE::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadiu
double r = xform( aRadius );
// N.B. This is backwards. We set this because we want to adjust the center
// point that changes both endpoints. In the worst case, this is twice as far.
// We cannot adjust radius or center based on the other because this causes the
// whole arc to change position/size
m_lineWidthIsOdd = !( static_cast<int>( aRadius ) % 2 );
VECTOR2D mid = roundp( xform( aCenterPoint ) );
VECTOR2D mid = xform( aCenterPoint );
double width = xform( aWidth / 2.0 );
VECTOR2D startPointS = VECTOR2D( r, 0.0 );
VECTOR2D endPointS = VECTOR2D( r, 0.0 );
@@ -1672,13 +1671,16 @@ bool CAIRO_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
}
bool CAIRO_GAL::SetNativeCursorStyle( KICURSOR aCursor )
bool CAIRO_GAL::SetNativeCursorStyle( KICURSOR aCursor, bool aHiDPI )
{
// Store the current cursor type and get the wxCursor for it
if( !GAL::SetNativeCursorStyle( aCursor ) )
if( !GAL::SetNativeCursorStyle( aCursor, aHiDPI ) )
return false;
m_currentwxCursor = CURSOR_STORE::GetCursor( m_currentNativeCursor );
if( aHiDPI )
m_currentwxCursor = CURSOR_STORE::GetHiDPICursor( m_currentNativeCursor );
else
m_currentwxCursor = CURSOR_STORE::GetCursor( m_currentNativeCursor );
// Update the cursor in the wx control
wxWindow::SetCursor( m_currentwxCursor );
@@ -1826,7 +1828,7 @@ void CAIRO_GAL_BASE::DrawGlyph( const KIFONT::GLYPH& aGlyph, int aNth, int aTota
for( const std::vector<VECTOR2D>& pointList : glyph )
drawPoly( pointList );
}
else if( aGlyph.IsOutline() )
else if( aGlyph.IsOutline() )
{
const KIFONT::OUTLINE_GLYPH& glyph = static_cast<const KIFONT::OUTLINE_GLYPH&>( aGlyph );
@@ -1864,15 +1866,9 @@ void CAIRO_GAL_BASE::DrawGlyph( const KIFONT::GLYPH& aGlyph, int aNth, int aTota
if( aNth == aTotal - 1 )
{
/*
cairo_close_path( currentContext );
setSourceRgba( currentContext, fillColor );
cairo_set_fill_rule( currentContext, CAIRO_FILL_RULE_EVEN_ODD );
cairo_fill_preserve( currentContext );
setSourceRgba( currentContext, strokeColor );
cairo_stroke( currentContext );
*/
flushPath();
SetIsFill( false );
SetIsStroke( true );
m_isElementAdded = true;
}
}
+259 -51
View File
@@ -44,85 +44,76 @@
#include <cursors/cursor-subtract.xpm>
#include <cursors/cursor-text.xpm>
#include <cursors/cursor-xor.xpm>
#include <cursors/cursor-zoom.xpm>
#include <cursors/cursor-zoom-in.xpm>
#include <cursors/cursor-zoom-out.xpm>
#include <cursors/cursor_tune.xpm>
#include <cursors/voltage_probe.xpm>
#include <cursors/current_probe.xpm>
// HiDPI cursor files
#include <cursors/cursor-add64.xpm>
#include <cursors/cursor-component64.xpm>
#include <cursors/cursor-eraser64.xpm>
#include <cursors/cursor-label-global64.xpm>
#include <cursors/cursor-label-hier64.xpm>
#include <cursors/cursor-label-net64.xpm>
#include <cursors/cursor-line-bus64.xpm>
#include <cursors/cursor-line-graphic64.xpm>
#include <cursors/cursor-line-wire64.xpm>
#include <cursors/cursor-line-wire-add64.xpm>
#include <cursors/cursor-measure64.xpm>
#include <cursors/cursor-pencil64.xpm>
#include <cursors/cursor-select-lasso64.xpm>
#include <cursors/cursor-select-window64.xpm>
#include <cursors/cursor-subtract64.xpm>
#include <cursors/cursor-text64.xpm>
#include <cursors/cursor-xor64.xpm>
#include <cursors/cursor-zoom-in64.xpm>
#include <cursors/cursor-zoom-out64.xpm>
#include <cursors/cursor_tune64.xpm>
#include <cursors/voltage_probe64.xpm>
#include <cursors/current_probe64.xpm>
// Under MSW, the standard cursor is white on black. Elsewhere it is black on white
#ifdef __WINDOWS__
#include <cursors/cursor-place.xpm>
#include <cursors/cursor-place64.xpm>
#include <cursors/cursor-select-m.xpm>
#include <cursors/cursor-select-m64.xpm>
#else
#include <cursors/cursor-place-black.xpm>
#include <cursors/cursor-place-black64.xpm>
#include <cursors/cursor-select-m-black.xpm>
#include <cursors/cursor-select-m-black64.xpm>
#endif
#include <wx/bitmap.h>
#include <wx/debug.h>
static const unsigned char voltage_probe[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00,
0x00, 0x30, 0x06, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x0e, 0x08, 0x00, 0x80, 0x07, 0x08, 0x00,
0xc0, 0x07, 0x18, 0x00, 0xe0, 0x07, 0x30, 0x00, 0xf0, 0x03, 0x60, 0x00, 0xf8, 0x01, 0x00, 0x00,
0xfc, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0xc0,
0x0f, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf0,
0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const unsigned char current_probe[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x60, 0x06, 0x00,
0x00, 0x30, 0x0c, 0x00, 0x00, 0x1c, 0x08, 0x00, 0x00, 0x0f, 0x08, 0x00, 0x80, 0x0f, 0x18, 0x00,
0xc0, 0x0f, 0x30, 0x80, 0xe1, 0x07, 0x60, 0x80, 0xf1, 0x03, 0x00, 0x80, 0xf9, 0x01, 0x00, 0x80,
0xfd, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0xc0,
0x0f, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x83,
0x01, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xfc,
0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00 };
static const unsigned char cursor_tune[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xc0, 0x0f, 0x00,
0x00, 0xe0, 0x1f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xfc, 0x07, 0x00,
0x00, 0xfe, 0x03, 0x00, 0x00, 0xff, 0x01, 0x00, 0x80, 0xff, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00,
0xe0, 0x3f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00,
0xfc, 0x03, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x50,
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0a,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 };
static const unsigned char cursor_tune_mask[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xc0, 0x0f,
0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xfc, 0x07,
0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0xff, 0x01, 0x00, 0x80, 0xff, 0x00, 0x00, 0xc0, 0x7f, 0x00,
0x00, 0xe0, 0x3f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x07, 0x00,
0x00, 0xfc, 0x03, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
0x70, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 };
static const std::vector<CURSOR_STORE::CURSOR_DEF> standard_cursors = {
{
KICURSOR::VOLTAGE_PROBE,
voltage_probe,
voltage_probe,
nullptr,
nullptr,
voltage_probe_xpm,
{ 32, 32 },
{ 1, 31 },
},
{
KICURSOR::CURRENT_PROBE,
current_probe,
current_probe,
nullptr,
nullptr,
current_probe_xpm,
{ 32, 32 },
{ 4, 27 },
},
{
KICURSOR::TUNE,
cursor_tune,
cursor_tune_mask,
nullptr,
nullptr,
cursor_tune_xpm,
{ 32, 32 },
{ 1, 30 },
},
@@ -198,7 +189,7 @@ static const std::vector<CURSOR_STORE::CURSOR_DEF> standard_cursors = {
KICURSOR::ZOOM_IN,
nullptr,
nullptr,
cursor_zoom_xpm,
cursor_zoom_in_xpm,
{ 32, 32 },
{ 6, 6 },
},
@@ -305,6 +296,209 @@ static const std::vector<CURSOR_STORE::CURSOR_DEF> standard_cursors = {
};
static const std::vector<CURSOR_STORE::CURSOR_DEF> hidpi_cursors = {
{
KICURSOR::VOLTAGE_PROBE,
nullptr,
nullptr,
voltage_probe64_xpm,
{ 64, 64 },
{ 1, 62 },
},
{
KICURSOR::CURRENT_PROBE,
nullptr,
nullptr,
current_probe64_xpm,
{ 64, 64 },
{ 8, 54 },
},
{
KICURSOR::TUNE,
nullptr,
nullptr,
cursor_tune64_xpm,
{ 64, 64 },
{ 2, 60 },
},
{
KICURSOR::PENCIL,
nullptr,
nullptr,
cursor_pencil64_xpm,
{ 64, 64 },
{ 8, 54 },
},
{
KICURSOR::MOVING,
nullptr,
nullptr,
#ifdef __WINDOWS__
cursor_select_m64_xpm,
#else
cursor_select_m_black64_xpm,
#endif
{ 64, 64 },
{ 2, 2 },
},
{
KICURSOR::REMOVE,
nullptr,
nullptr,
cursor_eraser64_xpm,
{ 64, 64 },
{ 8, 8 },
},
{
KICURSOR::TEXT,
nullptr,
nullptr,
cursor_text64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::MEASURE,
nullptr,
nullptr,
cursor_measure64_xpm,
{ 64, 64 },
{ 8, 8 },
},
{
KICURSOR::ADD,
nullptr,
nullptr,
cursor_add64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::SUBTRACT,
nullptr,
nullptr,
cursor_subtract64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::XOR,
nullptr,
nullptr,
cursor_xor64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::ZOOM_IN,
nullptr,
nullptr,
cursor_zoom_in64_xpm,
{ 64, 64 },
{ 12, 12 },
},
{
KICURSOR::ZOOM_OUT,
nullptr,
nullptr,
cursor_zoom_out64_xpm,
{ 64, 64 },
{ 12, 12 },
},
{
KICURSOR::LABEL_NET,
nullptr,
nullptr,
cursor_label_net64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::LABEL_GLOBAL,
nullptr,
nullptr,
cursor_label_global64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::COMPONENT,
nullptr,
nullptr,
cursor_component64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::SELECT_LASSO,
nullptr,
nullptr,
cursor_select_lasso64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::SELECT_WINDOW,
nullptr,
nullptr,
cursor_select_window64_xpm,
{ 64, 64 },
{ 14, 20 },
},
{
KICURSOR::LINE_BUS,
nullptr,
nullptr,
cursor_line_bus64_xpm,
{ 64, 64 },
{ 10, 52 },
},
{
KICURSOR::LINE_WIRE,
nullptr,
nullptr,
cursor_line_wire64_xpm,
{ 64, 64 },
{ 10, 52 },
},
{
KICURSOR::LINE_WIRE_ADD,
nullptr,
nullptr,
cursor_line_wire_add64_xpm,
{ 64, 64 },
{ 10, 52 },
},
{
KICURSOR::LINE_GRAPHIC,
nullptr,
nullptr,
cursor_line_graphic64_xpm,
{ 64, 64 },
{ 10, 52 },
},
{
KICURSOR::LABEL_HIER,
nullptr,
nullptr,
cursor_label_hier64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::PLACE,
nullptr,
nullptr,
#ifdef __WINDOWS__
cursor_place64_xpm,
#else
cursor_place_black64_xpm,
#endif
{ 64, 64 },
{ 2, 2 },
},
};
/**
* Construct a cursor for the given definition.
*
@@ -393,8 +587,8 @@ const wxCursor& CURSOR_STORE::Get( KICURSOR aIdKey ) const
const wxCursor CURSOR_STORE::GetCursor( KICURSOR aCursorType )
{
wxStockCursor stock =
GetStockCursor( aCursorType );
wxStockCursor stock = GetStockCursor( aCursorType );
if( stock != wxCURSOR_MAX )
{
return wxCursor( stock );
@@ -405,6 +599,20 @@ const wxCursor CURSOR_STORE::GetCursor( KICURSOR aCursorType )
}
const wxCursor CURSOR_STORE::GetHiDPICursor( KICURSOR aCursorType )
{
wxStockCursor stock = GetStockCursor( aCursorType );
if( stock != wxCURSOR_MAX )
{
return wxCursor( stock );
}
static CURSOR_STORE store( hidpi_cursors );
return store.Get( aCursorType );
}
wxStockCursor CURSOR_STORE::GetStockCursor( KICURSOR aCursorType )
{
wxStockCursor stockCursor;
+2 -2
View File
@@ -81,7 +81,7 @@ GAL::GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions ) :
SetCursorEnabled( false );
// Initialize the native widget to an arrow cursor
SetNativeCursorStyle( KICURSOR::ARROW );
SetNativeCursorStyle( KICURSOR::ARROW, false );
// Initialize text properties
ResetTextAttributes();
@@ -277,7 +277,7 @@ void GAL::BitmapText( const wxString& aText, const VECTOR2I& aPosition, const ED
}
bool GAL::SetNativeCursorStyle( KICURSOR aCursor )
bool GAL::SetNativeCursorStyle( KICURSOR aCursor, bool aHiDPI )
{
if( m_currentNativeCursor == aCursor )
return false;
+2 -9
View File
@@ -34,8 +34,7 @@ HIDPI_GL_CANVAS::HIDPI_GL_CANVAS( const KIGFX::VC_SETTINGS& aSettings, wxWindow*
const wxPoint& aPos, const wxSize& aSize, long aStyle,
const wxString& aName, const wxPalette& aPalette ) :
wxGLCanvas( aParent, aId, aAttribList, aPos, aSize, aStyle, aName, aPalette ),
m_settings( aSettings ),
m_scale_factor( DPI_SCALING::GetDefaultScaleFactor() )
m_settings( aSettings )
{
}
@@ -64,13 +63,7 @@ wxPoint HIDPI_GL_CANVAS::GetNativePosition( const wxPoint& aPoint ) const
}
void HIDPI_GL_CANVAS::SetScaleFactor( double aNewScaleFactor )
{
m_scale_factor = aNewScaleFactor;
}
double HIDPI_GL_CANVAS::GetScaleFactor() const
{
return m_scale_factor;
return GetContentScaleFactor();
}
+13 -12
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2012-2023 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012-2024 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013-2017 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@@ -33,6 +33,7 @@
#endif
#include <advanced_config.h>
#include <build_version.h>
#include <gal/opengl/opengl_gal.h>
#include <gal/opengl/utils.h>
#include <gal/definitions.h>
@@ -254,7 +255,8 @@ GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap )
bmp.accessTime = currentTime;
#ifndef DISABLE_BITMAP_CACHE
if( m_cacheLru.size() + 1 > m_cacheMaxElements || m_cacheSize + bmp.size > m_cacheMaxSize )
if( ( m_cacheLru.size() + 1 > m_cacheMaxElements || m_cacheSize + bmp.size > m_cacheMaxSize )
&& !m_cacheLru.empty() )
{
KIID toRemove( 0 );
auto toRemoveLru = m_cacheLru.end();
@@ -506,13 +508,6 @@ bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
refresh = true;
}
if( m_options.m_scaleFactor != GetScaleFactor() )
{
SetScaleFactor( m_options.m_scaleFactor );
m_gridLineWidth = m_options.m_scaleFactor * ( m_options.m_gridLineWidth + 0.25 );
refresh = true;
}
if( super::updatedGalDisplayOptions( aOptions ) || refresh )
{
Refresh();
@@ -2133,13 +2128,16 @@ void OPENGL_GAL::EndDiffLayer()
}
bool OPENGL_GAL::SetNativeCursorStyle( KICURSOR aCursor )
bool OPENGL_GAL::SetNativeCursorStyle( KICURSOR aCursor, bool aHiDPI )
{
// Store the current cursor type and get the wxCursor for it
if( !GAL::SetNativeCursorStyle( aCursor ) )
if( !GAL::SetNativeCursorStyle( aCursor, aHiDPI ) )
return false;
m_currentwxCursor = CURSOR_STORE::GetCursor( m_currentNativeCursor );
if( aHiDPI )
m_currentwxCursor = CURSOR_STORE::GetHiDPICursor( m_currentNativeCursor );
else
m_currentwxCursor = CURSOR_STORE::GetCursor( m_currentNativeCursor );
// Update the cursor in the wx control
HIDPI_GL_CANVAS::SetCursor( m_currentwxCursor );
@@ -2678,6 +2676,9 @@ void OPENGL_GAL::init()
#endif // KICAD_USE_EGL
SetOpenGLInfo( (const char*) glGetString( GL_VENDOR ), (const char*) glGetString( GL_RENDERER ),
(const char*) glGetString( GL_VERSION ) );
if( GLEW_OK != err )
throw std::runtime_error( (const char*) glewGetErrorString( err ) );
+16 -1
View File
@@ -693,7 +693,14 @@ void GRID_TRICKS::paste_clipboard()
wxTheClipboard->GetData( data );
paste_text( data.GetText() );
wxString text = data.GetText();
#ifdef __WXMAC__
// Some editors use windows linefeeds (\r\n), which wx re-writes to \n\n
text.Replace( "\n\n", "\n" );
#endif
paste_text( text );
}
wxTheClipboard->Close();
@@ -802,6 +809,14 @@ void GRID_TRICKS::paste_text( const wxString& cb_text )
{
tbl->SetValue( row, col, cellTxt );
wxGridEvent evt( m_grid->GetId(), wxEVT_GRID_CELL_CHANGED, m_grid, row, col );
m_grid->GetEventHandler()->ProcessEvent( evt );
}
// Allow paste to any cell that can accept a boolean value
else if( tbl->CanSetValueAs( row, col, wxGRID_VALUE_BOOL ) )
{
tbl->SetValueAsBool( row, col, cellTxt == wxT( "1" ) );
wxGridEvent evt( m_grid->GetId(), wxEVT_GRID_CELL_CHANGED, m_grid, row, col );
m_grid->GetEventHandler()->ProcessEvent( evt );
}
+16 -13
View File
@@ -98,7 +98,7 @@ DXF_IMPORT_PLUGIN::DXF_IMPORT_PLUGIN() : DL_CreationAdapter()
m_brdLayer = Dwgs_User; // The default import layer
m_importAsFPShapes = true;
m_minX = m_minY = std::numeric_limits<double>::max();
m_maxX = m_maxY = std::numeric_limits<double>::min();
m_maxX = m_maxY = std::numeric_limits<double>::lowest();
m_currentUnit = DXF_IMPORT_UNITS::DEFAULT;
m_importCoordinatePrecision = 4; // initial value per dxf spec
@@ -131,7 +131,7 @@ bool DXF_IMPORT_PLUGIN::Load( const wxString& aFileName )
m_internalImporter.ClearShapes();
reportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) );
ReportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) );
return false;
}
}
@@ -151,7 +151,7 @@ bool DXF_IMPORT_PLUGIN::LoadFromMemory( const wxMemoryBuffer& aMemBuffer )
m_internalImporter.ClearShapes();
reportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) );
ReportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) );
return false;
}
}
@@ -247,7 +247,7 @@ bool DXF_IMPORT_PLUGIN::ImportDxfFile( const wxMemoryBuffer& aMemBuffer )
}
void DXF_IMPORT_PLUGIN::reportMsg( const wxString& aMessage )
void DXF_IMPORT_PLUGIN::ReportMsg( const wxString& aMessage )
{
// Add message to keep trace of not handled dxf entities
m_messages += aMessage;
@@ -642,10 +642,6 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
if( startAngle > endAngle )
endAngle += ANGLE_360;
// Angles are relative to major axis
startAngle -= EDA_ANGLE( major );
endAngle -= EDA_ANGLE( major );
if( aData.ratio == 1.0 )
{
double radius = major.EuclideanNorm();
@@ -658,6 +654,10 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
}
else
{
// Angles are relative to major axis
startAngle -= EDA_ANGLE( major );
endAngle -= EDA_ANGLE( major );
DL_ArcData arc( aData.cx, aData.cy, aData.cz, radius, startAngle.AsDegrees(),
endAngle.AsDegrees() );
addArc( arc );
@@ -1411,8 +1411,8 @@ void DXF_IMPORT_PLUGIN::insertSpline( double aWidth )
ctrlp.push_back( m_curr_entity.m_SplineControlPointList[ii].m_y );
}
std::vector<double> coords;
tinyspline::BSpline beziers;
std::vector<double> coords;
try
{
@@ -1421,15 +1421,18 @@ void DXF_IMPORT_PLUGIN::insertSpline( double aWidth )
dxfspline.setControlPoints( ctrlp );
dxfspline.setKnots( m_curr_entity.m_SplineKnotsList );
beziers = tinyspline::BSpline( dxfspline.toBeziers() );
if( dxfspline.degree() < 3 )
dxfspline = dxfspline.elevateDegree( 3 - dxfspline.degree() );
beziers = dxfspline.toBeziers();
coords = beziers.controlPoints();
}
catch( const std::runtime_error& ) // tinyspline throws everything including data validation
// as runtime errors
{
// invalid spline definition, drop this block
reportMsg( _( "Invalid spline definition encountered" ) );
ReportMsg( _( "Invalid spline definition encountered" ) );
return;
}
@@ -1446,14 +1449,14 @@ void DXF_IMPORT_PLUGIN::insertSpline( double aWidth )
// not sure why this happens, but it seems to sometimes slip degree on the final bezier
VECTOR2D bezierControl2;
if( ii + 4 >= coords.size() )
if( ii + 5 >= coords.size() )
bezierControl2 = bezierControl1;
else
bezierControl2 = VECTOR2D( mapX( coords[ii + 4] ), mapY( coords[ii + 5] ) );
VECTOR2D end;
if( ii + 6 >= coords.size() )
if( ii + 7 >= coords.size() )
end = bezierControl2;
else
end = VECTOR2D( mapX( coords[ii + 6] ), mapY( coords[ii + 7] ) );
+18 -18
View File
@@ -320,10 +320,10 @@ public:
{
return m_messages;
}
// report message to keep trace of not supported dxf entities:
void ReportMsg( const wxString& aMessage ) override;
private:
// report message to keep trace of not supported dxf entities:
void reportMsg( const wxString& aMessage );
// coordinate conversions from dxf file to mm
double mapX( double aDxfCoordX );
@@ -455,77 +455,77 @@ private:
// Not yet handled DXF entities:
virtual void addXLine( const DL_XLineData& ) override
{
reportMsg( _( "DXF construction lines not currently supported." ) );
ReportMsg( _( "DXF construction lines not currently supported." ) );
}
virtual void addRay( const DL_RayData& ) override
{
reportMsg( _( "DXF construction lines not currently supported." ) );
ReportMsg( _( "DXF construction lines not currently supported." ) );
}
virtual void addArcAlignedText( const DL_ArcAlignedTextData& ) override
{
reportMsg( _( "DXF arc-aligned text not currently supported." ) );
ReportMsg( _( "DXF arc-aligned text not currently supported." ) );
}
virtual void addDimAlign( const DL_DimensionData&, const DL_DimAlignedData& ) override
{
reportMsg( _( "DXF dimensions not currently supported." ) );
ReportMsg( _( "DXF dimensions not currently supported." ) );
}
virtual void addDimLinear( const DL_DimensionData&, const DL_DimLinearData& ) override
{
reportMsg( _( "DXF dimensions not currently supported." ) );
ReportMsg( _( "DXF dimensions not currently supported." ) );
}
virtual void addDimRadial( const DL_DimensionData&, const DL_DimRadialData& ) override
{
reportMsg( _( "DXF dimensions not currently supported." ) );
ReportMsg( _( "DXF dimensions not currently supported." ) );
}
virtual void addDimDiametric( const DL_DimensionData&, const DL_DimDiametricData& ) override
{
reportMsg( _( "DXF dimensions not currently supported." ) );
ReportMsg( _( "DXF dimensions not currently supported." ) );
}
virtual void addDimAngular( const DL_DimensionData&, const DL_DimAngular2LData& ) override
{
reportMsg( _( "DXF dimensions not currently supported." ) );
ReportMsg( _( "DXF dimensions not currently supported." ) );
}
virtual void addDimAngular3P( const DL_DimensionData&, const DL_DimAngular3PData& ) override
{
reportMsg( _( "DXF dimensions not currently supported." ) );
ReportMsg( _( "DXF dimensions not currently supported." ) );
}
virtual void addDimOrdinate( const DL_DimensionData&, const DL_DimOrdinateData& ) override
{
reportMsg( _( "DXF dimensions not currently supported." ) );
ReportMsg( _( "DXF dimensions not currently supported." ) );
}
virtual void addLeader( const DL_LeaderData& ) override
{
reportMsg( _( "DXF dimensions not currently supported." ) );
ReportMsg( _( "DXF dimensions not currently supported." ) );
}
virtual void addLeaderVertex( const DL_LeaderVertexData& ) override { }
virtual void addHatch( const DL_HatchData& ) override
{
reportMsg( _( "DXF hatches not currently supported." ) );
ReportMsg( _( "DXF hatches not currently supported." ) );
}
virtual void addHatchLoop( const DL_HatchLoopData& ) override { }
virtual void addHatchEdge( const DL_HatchEdgeData& ) override { }
virtual void addTrace( const DL_TraceData& ) override
{
reportMsg( _( "DXF traces not currently supported." ) );
ReportMsg( _( "DXF traces not currently supported." ) );
}
virtual void add3dFace( const DL_3dFaceData& ) override
{
reportMsg( _( "DXF 3dfaces not currently supported." ) );
ReportMsg( _( "DXF 3dfaces not currently supported." ) );
}
virtual void addSolid( const DL_SolidData& ) override
{
reportMsg( _( "DXF solids not currently supported." ) );
ReportMsg( _( "DXF solids not currently supported." ) );
}
virtual void addImage( const DL_ImageData& ) override
{
reportMsg( _( "DXF images not currently supported." ) );
ReportMsg( _( "DXF images not currently supported." ) );
}
virtual void linkImage( const DL_ImageDefData& ) override {}
@@ -131,6 +131,8 @@ public:
*/
const virtual wxString& GetMessages() const = 0;
virtual void ReportMsg( const wxString& aMessage ) = 0;
protected:
///< Importer used to create objects representing the imported shapes.
GRAPHICS_IMPORTER* m_importer;
+5
View File
@@ -125,6 +125,11 @@ public:
return m_plugin->GetMessages();
}
void ReportMsg( const wxString& aMessage )
{
m_plugin->ReportMsg( aMessage );
}
/**
* Get original image Width.
*
@@ -98,6 +98,89 @@ void GRAPHICS_IMPORTER_BUFFER::AddShape( std::unique_ptr<IMPORTED_SHAPE>& aShape
void GRAPHICS_IMPORTER_BUFFER::ImportTo( GRAPHICS_IMPORTER& aImporter )
{
BOX2D boundingBox;
for( std::unique_ptr<IMPORTED_SHAPE>& shape : m_shapes )
{
BOX2D box = shape->GetBoundingBox();
if( box.IsValid() )
boundingBox.Merge( box );
}
boundingBox.SetOrigin( boundingBox.GetPosition().x * aImporter.GetScale().x,
boundingBox.GetPosition().y * aImporter.GetScale().y );
boundingBox.SetSize( boundingBox.GetSize().x * aImporter.GetScale().x,
boundingBox.GetSize().y * aImporter.GetScale().y );
// Check that the scaled graphics fit in the KiCad numeric limits
if( boundingBox.GetSize().x * aImporter.GetMillimeterToIuFactor() > std::numeric_limits<int>::max() ||
boundingBox.GetSize().y * aImporter.GetMillimeterToIuFactor() > std::numeric_limits<int>::max() )
{
double scale_factor = std::numeric_limits<int>::max() / ( aImporter.GetMillimeterToIuFactor() + 100 );
double max_scale = std::max( scale_factor / boundingBox.GetSize().x,
scale_factor / boundingBox.GetSize().y );
aImporter.ReportMsg( wxString::Format( _( "Imported graphic is too large. Maximum scale is %f" ),
max_scale ) );
return;
}
// They haven't set the import offset, so we set it to the bounding box origin to keep the graphics
// in the KiCad drawing area
else if( aImporter.GetImportOffsetMM() == VECTOR2D( 0, 0 ) )
{
VECTOR2D offset = boundingBox.GetOrigin();
aImporter.SetImportOffsetMM( -offset );
}
else
{
VECTOR2D bbox_origin = boundingBox.GetOrigin();
aImporter.SetImportOffsetMM( -bbox_origin + aImporter.GetImportOffsetMM() );
double total_scale_x = aImporter.GetScale().x * aImporter.GetMillimeterToIuFactor();
double total_scale_y = aImporter.GetScale().y * aImporter.GetMillimeterToIuFactor();
double max_offset_x =
( aImporter.GetImportOffsetMM().x + boundingBox.GetRight() ) * total_scale_x;
double max_offset_y =
( aImporter.GetImportOffsetMM().y + boundingBox.GetBottom() ) * total_scale_y;
double min_offset_x =
( aImporter.GetImportOffsetMM().x + boundingBox.GetLeft() ) * total_scale_x;
double min_offset_y =
( aImporter.GetImportOffsetMM().y + boundingBox.GetTop() ) * total_scale_y;
VECTOR2D newOffset = aImporter.GetImportOffsetMM();
bool needsAdjustment = false;
if( max_offset_x >= std::numeric_limits<int>::max() )
{
newOffset.x -= ( max_offset_x - std::numeric_limits<int>::max() + 100.0 ) / total_scale_x;
needsAdjustment = true;
}
else if( min_offset_x <= std::numeric_limits<int>::min() )
{
newOffset.x -= ( min_offset_x - std::numeric_limits<int>::min() - 100 ) / total_scale_x;
needsAdjustment = true;
}
if( max_offset_y >= std::numeric_limits<int>::max() )
{
newOffset.y -= ( max_offset_y - std::numeric_limits<int>::max() + 100 ) / total_scale_y;
needsAdjustment = true;
}
else if( min_offset_y <= std::numeric_limits<int>::min() )
{
newOffset.y -= ( min_offset_y - std::numeric_limits<int>::min() - 100 ) / total_scale_y;
needsAdjustment = true;
}
if( needsAdjustment )
{
aImporter.ReportMsg( wxString::Format( _( "Import offset adjusted to (%f, %f) to fit within numeric limits" ),
newOffset.x, newOffset.y ) );
aImporter.SetImportOffsetMM( newOffset );
}
}
for( std::unique_ptr<IMPORTED_SHAPE>& shape : m_shapes )
shape->ImportTo( aImporter );
}
@@ -30,6 +30,7 @@
#include "graphics_importer.h"
#include <math/matrix3x3.h>
#include <math/box2.h>
#include <list>
@@ -46,6 +47,8 @@ public:
void SetParentShapeIndex( int aIndex ) { m_parentShapeIndex = aIndex; }
int GetParentShapeIndex() const { return m_parentShapeIndex; }
virtual BOX2D GetBoundingBox() const = 0;
protected:
int m_parentShapeIndex = -1;
};
@@ -75,6 +78,14 @@ public:
m_end = aTransform * m_end + aTranslation;
}
BOX2D GetBoundingBox() const override
{
BOX2D box;
box.Merge( m_start );
box.Merge( m_end );
return box;
}
private:
VECTOR2D m_start;
VECTOR2D m_end;
@@ -113,6 +124,14 @@ public:
m_radius = newRadius.EuclideanNorm();
}
BOX2D GetBoundingBox() const override
{
BOX2D box;
box.Merge( m_center - VECTOR2D( m_radius, m_radius ) );
box.Merge( m_center + VECTOR2D( m_radius, m_radius ) );
return box;
}
private:
VECTOR2D m_center;
double m_radius;
@@ -148,6 +167,26 @@ public:
m_center = aTransform * m_center + aTranslation;
}
BOX2D GetBoundingBox() const override
{
BOX2D box;
box.Merge( m_start + m_stroke.GetWidth() );
box.Merge( m_start - m_stroke.GetWidth() );
for( double angle = 0; angle < m_angle.AsDegrees(); angle += 5 )
{
EDA_ANGLE ang = EDA_ANGLE( angle );
VECTOR2D start = m_center + m_start;
VECTOR2D pt = {start.x * ang.Cos() + start.y * ang.Sin(),
start.x * ang.Sin() - start.y * ang.Cos()};
box.Merge( pt );
}
return box;
}
private:
VECTOR2D m_center;
VECTOR2D m_start;
@@ -192,6 +231,16 @@ public:
const IMPORTED_STROKE& GetStroke() const { return m_stroke; }
BOX2D GetBoundingBox() const override
{
BOX2D box;
for( const VECTOR2D& vert : m_vertices )
box.Merge( vert );
return box;
}
private:
std::vector<VECTOR2D> m_vertices;
IMPORTED_STROKE m_stroke;
@@ -227,6 +276,19 @@ public:
void Transform( const MATRIX3x3D& aTransform, const VECTOR2D& aTranslation ) override
{
m_origin = aTransform * m_origin + aTranslation;
VECTOR2D textSize = aTransform * VECTOR2D( m_width, m_height );
m_width = textSize.x;
m_height = textSize.y;
}
BOX2D GetBoundingBox() const override
{
BOX2D box;
box.Merge( m_origin );
box.Merge( m_origin + VECTOR2D( m_width * m_text.length(), m_height ) );
return box;
}
private:
@@ -272,6 +334,14 @@ public:
m_end = aTransform * m_end + aTranslation;
}
BOX2D GetBoundingBox() const override
{
BOX2D box;
box.Merge( m_start );
box.Merge( m_end );
return box;
}
private:
VECTOR2D m_start;
VECTOR2D m_bezierControl1;
+8
View File
@@ -426,3 +426,11 @@ static float distanceFromPointToLine( const VECTOR2D& aPoint, const VECTOR2D& aL
return fabs( distance );
}
void SVG_IMPORT_PLUGIN::ReportMsg( const wxString& aMessage )
{
// Add message to keep trace of not handled svg entities
m_messages += aMessage;
m_messages += '\n';
}
+2
View File
@@ -62,6 +62,8 @@ public:
return m_messages;
}
void ReportMsg( const wxString& aMessage ) override;
bool Import() override;
bool Load( const wxString& aFileName ) override;
bool LoadFromMemory( const wxMemoryBuffer& aMemBuffer ) override;
+2 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2023-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -246,7 +246,7 @@ EASYEDA_PARSER_BASE::ParseLineChains( const wxString& data, int aArcMinSegLen, b
arc.ConstructFromStartEndCenter( RelPos( start ), RelPos( end ), RelPos( arcCenter ),
!cw );
chain.Append( arc );
chain.Append( arc, aArcMinSegLen );
prevPt = end;
}
@@ -140,7 +140,8 @@ EASYEDAPRO::ProjectToSelectorDialog( const nlohmann::json& aProject, bool aPcbOn
}
nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName )
nlohmann::json EASYEDAPRO::FindJsonFile( const wxString& aZipFileName,
const std::set<wxString>& aFileNames )
{
std::shared_ptr<wxZipEntry> entry;
wxFFileInputStream in( aZipFileName );
@@ -152,7 +153,7 @@ nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName
try
{
if( name == wxS( "project.json" ) || name == wxS( "device.json" ) )
if( aFileNames.find( name ) != aFileNames.end() )
{
wxMemoryOutputStream memos;
memos << zip;
@@ -175,6 +176,20 @@ nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName
}
}
return nlohmann::json{};
}
nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName )
{
static const std::set<wxString> c_files = { wxS( "project.json" ), wxS( "device.json" ),
wxS( "footprint.json" ), wxS( "symbol.json" ) };
nlohmann::json j = FindJsonFile( aZipFileName, c_files );
if( !j.is_null() )
return j;
THROW_IO_ERROR( wxString::Format(
_( "'%s' does not appear to be a valid EasyEDA (JLCEDA) Pro "
"project or library file. Cannot find project.json or device.json." ),
@@ -230,8 +245,17 @@ std::vector<nlohmann::json> EASYEDAPRO::ParseJsonLines( wxInputStream& aInput,
{
try
{
nlohmann::json js = nlohmann::json::parse( txt.ReadLine() );
lines.emplace_back( js );
wxString line = txt.ReadLine();
if( !line.IsEmpty() )
{
nlohmann::json js = nlohmann::json::parse( line );
lines.emplace_back( js );
}
else
{
lines.emplace_back( nlohmann::json() );
}
}
catch( nlohmann::json::exception& e )
{
@@ -244,3 +268,59 @@ std::vector<nlohmann::json> EASYEDAPRO::ParseJsonLines( wxInputStream& aInput,
return lines;
}
std::vector<std::vector<nlohmann::json>>
EASYEDAPRO::ParseJsonLinesWithSeparation( wxInputStream& aInput, const wxString& aSource )
{
wxTextInputStream txt( aInput, wxS( " " ), wxConvUTF8 );
int currentLine = 1;
std::vector<std::vector<nlohmann::json>> lineBlocks;
lineBlocks.emplace_back();
while( aInput.CanRead() )
{
try
{
wxString line = txt.ReadLine();
if( !line.IsEmpty() )
{
nlohmann::json js = nlohmann::json::parse( line );
lineBlocks.back().emplace_back( js );
}
else
{
lineBlocks.emplace_back();
}
}
catch( nlohmann::json::exception& e )
{
wxLogWarning( wxString::Format( _( "Cannot parse JSON line %d in '%s': %s" ),
currentLine, aSource, e.what() ) );
}
currentLine++;
}
return lineBlocks;
}
std::map<wxString, wxString>
EASYEDAPRO::AnyMapToStringMap( const std::map<wxString, nlohmann::json>& aInput )
{
std::map<wxString, wxString> stringMap;
for( auto& [key, value] : aInput )
{
if( value.is_string() )
stringMap[key] = value.get<wxString>();
else if( value.is_number() )
stringMap[key] = wxString::FromCDouble( value.get<double>() );
}
return stringMap;
}
@@ -25,6 +25,7 @@
#ifndef EASYEDAPRO_IMPORT_UTILS_H_
#define EASYEDAPRO_IMPORT_UTILS_H_
#include <set>
#include <wx/stream.h>
#include <wx/string.h>
#include <lib_id.h>
@@ -46,6 +47,8 @@ std::vector<IMPORT_PROJECT_DESC> ProjectToSelectorDialog( const nlohmann::json&
bool aPcbOnly = false,
bool aSchOnly = false );
nlohmann::json FindJsonFile( const wxString& aZipFileName, const std::set<wxString>& aFileNames );
nlohmann::json ReadProjectOrDeviceFile( const wxString& aZipFileName );
void IterateZipFiles(
@@ -54,6 +57,14 @@ void IterateZipFiles(
std::vector<nlohmann::json> ParseJsonLines( wxInputStream& aInput, const wxString& aSource );
/**
* Multiple document types (e.g. footprint and PCB) can be put into a single file, separated by empty line.
*/
std::vector<std::vector<nlohmann::json>> ParseJsonLinesWithSeparation( wxInputStream& aInput,
const wxString& aSource );
std::map<wxString, wxString> AnyMapToStringMap( const std::map<wxString, nlohmann::json>& aInput );
} // namespace EASYEDAPRO
+5 -2
View File
@@ -29,6 +29,7 @@
#include <nlohmann/json.hpp>
#include <core/json_serializers.h>
#include <string_utils.h>
#include <io/easyedapro/easyedapro_import_utils.h>
void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::SCH_ATTR& d )
@@ -36,7 +37,9 @@ void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::SCH_ATTR& d )
d.id = j.at( 1 ).get<wxString>();
d.parentId = j.at( 2 ).get<wxString>();
d.key = j.at( 3 ).get<wxString>();
d.value = j.at( 4 ).get<wxString>();
if( j.at( 4 ).is_string() )
d.value = j.at( 4 ).get<wxString>();
if( j.at( 5 ).is_number() )
d.keyVisible = j.at( 5 ).get<int>();
@@ -271,7 +274,7 @@ void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::PRJ_DEVICE& d )
d.custom_tags = j.at( "custom_tags" );
if( j.at( "attributes" ).is_object() )
d.attributes = j.at( "attributes" );
d.attributes = AnyMapToStringMap( j.at( "attributes" ) );
}
void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::BLOB& d )
+2 -1
View File
@@ -41,7 +41,8 @@
namespace EASYEDAPRO
{
static const bool IMPORT_POURED = false;
static const bool IMPORT_POURED = true;
static const bool IMPORT_POURED_ECOP = false;
enum class SYMBOL_TYPE
{
+24 -1
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -27,11 +27,18 @@
// conflicts for some defines, at least on Windows
#include <kicad_curl/kicad_curl.h>
#include <mutex>
#include <ki_exception.h> // THROW_IO_ERROR
static std::shared_mutex s_curlMutex;
static bool s_curlShuttingDown = false;
void KICAD_CURL::Init()
{
s_curlShuttingDown = false;
if( curl_global_init( CURL_GLOBAL_ALL ) != CURLE_OK )
{
THROW_IO_ERROR( "curl_global_init() failed." );
@@ -41,10 +48,26 @@ void KICAD_CURL::Init()
void KICAD_CURL::Cleanup()
{
s_curlShuttingDown = true;
std::unique_lock lock( s_curlMutex );
curl_global_cleanup();
}
std::shared_mutex& KICAD_CURL::Mutex()
{
return s_curlMutex;
}
bool KICAD_CURL::IsShuttingDown()
{
return s_curlShuttingDown;
}
std::string GetKicadCurlVersion()
{
return KICAD_CURL::GetVersion();
+11 -1
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 2015-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -33,6 +33,7 @@
#include <cstddef>
#include <exception>
#include <sstream>
#include <shared_mutex>
#include <wx/app.h>
#include <build_version.h>
@@ -88,6 +89,9 @@ static size_t stream_write_callback( void* aContents, size_t aSize, size_t aNmem
static int xferinfo( void* aProgress, curl_off_t aDLtotal, curl_off_t aDLnow, curl_off_t aULtotal,
curl_off_t aULnow )
{
if( KICAD_CURL::IsShuttingDown() )
return 1; // Should abort the operation
CURL_PROGRESS* progress = static_cast<CURL_PROGRESS*>( aProgress );
curl_off_t curtime = 0;
@@ -190,6 +194,12 @@ KICAD_CURL_EASY::~KICAD_CURL_EASY()
int KICAD_CURL_EASY::Perform()
{
std::shared_lock lock( KICAD_CURL::Mutex(), std::try_to_lock );
// If can't lock, we should be in the process of tearing down.
if( !lock )
return CURLE_ABORTED_BY_CALLBACK;
if( m_headers )
curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
+2 -10
View File
@@ -25,9 +25,9 @@
#include <kiid.h>
#include <boost/random/mersenne_twister.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/functional/hash.hpp>
#if BOOST_VERSION >= 106700
#include <boost/uuid/entropy_error.hpp>
@@ -235,15 +235,7 @@ timestamp_t KIID::AsLegacyTimestamp() const
size_t KIID::Hash() const
{
size_t hash = 0;
// Note: this is NOT little-endian/big-endian safe, but as long as it's just used
// at runtime it won't matter.
for( int i = 0; i < 4; ++i )
boost::hash_combine( hash, reinterpret_cast<const uint32_t*>( m_uuid.data )[i] );
return hash;
return boost::uuids::hash_value( m_uuid );
}
+14 -1
View File
@@ -57,7 +57,6 @@ KIWAY_PLAYER::KIWAY_PLAYER( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType
KIWAY_PLAYER::~KIWAY_PLAYER() throw()
{
// socket server must be destructed before we complete
// destructing the frame or else we could crash
// as the socket server holds a reference to this frame
@@ -69,6 +68,20 @@ KIWAY_PLAYER::~KIWAY_PLAYER() throw()
delete m_socketServer;
m_socketServer = nullptr;
}
// remove active sockets as well
for( wxSocketBase* socket : m_sockets )
{
if( !socket )
continue;
// ensure any event handling stops
socket->Notify( false );
delete socket;
}
m_sockets.clear();
}
+1
View File
@@ -24,6 +24,7 @@
*/
#include <wx/debug.h>
#include <wx/filename.h>
#include <set>
#include <common.h>
+9 -5
View File
@@ -21,7 +21,8 @@
#include "lib_table_grid.h"
LIB_TABLE_GRID_TRICKS::LIB_TABLE_GRID_TRICKS( WX_GRID* aGrid ) : GRID_TRICKS( aGrid )
LIB_TABLE_GRID_TRICKS::LIB_TABLE_GRID_TRICKS( WX_GRID* aGrid ) :
GRID_TRICKS( aGrid )
{
}
@@ -65,11 +66,14 @@ void LIB_TABLE_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
if( showDeactivate )
menu.Append( LIB_TABLE_GRID_TRICKS_DEACTIVATE_SELECTED, _( "Deactivate selected" ) );
if( showSetVisible )
menu.Append( LIB_TABLE_GRID_TRICKS_SET_VISIBLE, _( "Set visible flag" ) );
if( supportsVisibilityColumn() )
{
if( showSetVisible )
menu.Append( LIB_TABLE_GRID_TRICKS_SET_VISIBLE, _( "Set visible flag" ) );
if( showUnsetVisible )
menu.Append( LIB_TABLE_GRID_TRICKS_UNSET_VISIBLE, _( "Unset visible flag" ) );
if( showUnsetVisible )
menu.Append( LIB_TABLE_GRID_TRICKS_UNSET_VISIBLE, _( "Unset visible flag" ) );
}
bool showSettings = false;
+1 -1
View File
@@ -416,7 +416,7 @@ wxDataViewColumn* LIB_TREE_MODEL_ADAPTER::doAddColumn( const wxString& aHeader,
wxDataViewColumn* col = new wxDataViewColumn(
translatedHeader, new LIB_TREE_RENDERER(), index, m_colWidths[aHeader], wxALIGN_NOT,
wxDATAVIEW_CELL_INERT | wxDATAVIEW_COL_RESIZABLE | wxDATAVIEW_COL_SORTABLE );
wxDATAVIEW_CELL_INERT | static_cast<int>( wxDATAVIEW_COL_RESIZABLE ) );
m_widget->AppendColumn( col );
col->SetMinWidth( headerMinWidth.x );
+2 -2
View File
@@ -273,7 +273,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
}
ch = m_token.input[ ++m_token.pos ];
} while( isdigit( ch ) || isDecimalSeparator( ch ) );
} while( isdigit( (unsigned char) ch ) || isDecimalSeparator( ch ) );
m_token.token[ idx ] = 0;
};
@@ -373,7 +373,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
{
/* End of input */
}
else if( isdigit( ch ) || isDecimalSeparator( ch ) )
else if( isdigit( (unsigned char) ch ) || isDecimalSeparator( ch ) )
{
// VALUE
extractNumber( &siScaler );
+1
View File
@@ -178,6 +178,7 @@ public:
m_contentSizer->Add( m_noNotificationsText, 1, wxALL | wxEXPAND, 5 );
Bind( wxEVT_KILL_FOCUS, &NOTIFICATIONS_LIST::onFocusLoss, this );
m_scrolledWindow->Bind( wxEVT_KILL_FOCUS, &NOTIFICATIONS_LIST::onFocusLoss, this );
SetSizer( bSizer1 );
Layout();
+11 -5
View File
@@ -153,6 +153,9 @@ PGM_BASE::~PGM_BASE()
}
delete[] m_argvUtf8;
delete m_locale;
m_locale = nullptr;
}
@@ -164,10 +167,6 @@ void PGM_BASE::Destroy()
sentry_close();
#endif
// unlike a normal destructor, this is designed to be called more than once safely:
delete m_locale;
m_locale = nullptr;
m_pgm_checker.reset();
}
@@ -492,8 +491,15 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
}
#endif
// Ensure the instance checker directory exists
// It should be globally writable because it is shared between all users on Linux, and so on a
// multi-user machine, other need to be able to access it to check for the lock files or make
// their own lock files.
wxString instanceCheckerDir = PATHS::GetInstanceCheckerPath();
PATHS::EnsurePathExists( instanceCheckerDir );
wxChmod( instanceCheckerDir, wxPOSIX_USER_READ | wxPOSIX_USER_WRITE | wxPOSIX_USER_EXECUTE |
wxPOSIX_GROUP_READ | wxPOSIX_GROUP_WRITE | wxPOSIX_GROUP_EXECUTE |
wxPOSIX_OTHERS_READ | wxPOSIX_OTHERS_WRITE | wxPOSIX_OTHERS_EXECUTE );
wxString instanceCheckerName = wxString::Format( wxS( "%s-%s" ), pgm_name,
GetMajorMinorVersion() );
@@ -990,7 +996,7 @@ void PGM_BASE::HandleAssert( const wxString& aFile, int aLine, const wxString& a
{
static std::set<SENTRY_ASSERT_CACHE_KEY> assertCache;
SENTRY_ASSERT_CACHE_KEY key = { aFile, aLine, aFunc, aCond, aMsg };
SENTRY_ASSERT_CACHE_KEY key = { aFile, aLine, aFunc, aCond };
if( assertCache.find( key ) == assertCache.end() )
{
+42 -12
View File
@@ -7,7 +7,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 Lorenzo Marcantonio, l.marcantonio@logossrl.com
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -37,7 +37,8 @@
#include <wx/datstrm.h>
#include <advanced_config.h>
#include <eda_text.h> // for IsGotoPageHref
#include <common.h> // ResolveUriByEnvVars
#include <eda_text.h> // for IsGotoPageHref
#include <font/font.h>
#include <core/ignore.h>
#include <macros.h>
@@ -400,12 +401,12 @@ void PDF_PLOTTER::PlotPoly( const std::vector<VECTOR2I>& aCornerList, FILL_T aFi
SetCurrentLineWidth( aWidth );
VECTOR2D pos = userToDeviceCoordinates( aCornerList[0] );
fprintf( m_workFile, "%g %g m\n", pos.x, pos.y );
fprintf( m_workFile, "%f %f m\n", pos.x, pos.y );
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
{
pos = userToDeviceCoordinates( aCornerList[ii] );
fprintf( m_workFile, "%g %g l\n", pos.x, pos.y );
fprintf( m_workFile, "%f %f l\n", pos.x, pos.y );
}
// Close path and stroke and/or fill
@@ -438,7 +439,7 @@ void PDF_PLOTTER::PenTo( const VECTOR2I& pos, char plume )
if( m_penState != plume || pos != m_penLastpos )
{
VECTOR2D pos_dev = userToDeviceCoordinates( pos );
fprintf( m_workFile, "%g %g %c\n",
fprintf( m_workFile, "%f %f %c\n",
pos_dev.x, pos_dev.y,
( plume=='D' ) ? 'l' : 'm' );
}
@@ -1332,16 +1333,35 @@ bool PDF_PLOTTER::EndPlot()
{
wxString href = property.substr( property.Find( "http:" ) );
if( m_project )
href = ResolveUriByEnvVars( href, m_project );
js += wxString::Format( wxT( "[\"%s\", \"%s\"],\n" ),
EscapeString( property, CTX_JS_STR ),
EscapeString( href, CTX_JS_STR ),
EscapeString( href, CTX_JS_STR ) );
}
else if( property.Find( "https:" ) >= 0 )
{
wxString href = property.substr( property.Find( "https:" ) );
if( m_project )
href = ResolveUriByEnvVars( href, m_project );
js += wxString::Format( wxT( "[\"%s\", \"%s\"],\n" ),
EscapeString( property, CTX_JS_STR ),
EscapeString( href, CTX_JS_STR ),
EscapeString( href, CTX_JS_STR ) );
}
else if( property.Find( "file:" ) >= 0 )
{
wxString href = property.substr( property.Find( "file:" ) );
if( m_project )
href = ResolveUriByEnvVars( href, m_project );
href = NormalizeFileUri( href );
js += wxString::Format( wxT( "[\"%s\", \"%s\"],\n" ),
EscapeString( href, CTX_JS_STR ),
EscapeString( href, CTX_JS_STR ) );
}
else
@@ -1367,13 +1387,22 @@ bool PDF_PLOTTER::EndPlot()
}
}
}
else if( url.StartsWith( "http:" ) || url.StartsWith( "https:" ) )
else if( url.StartsWith( "http:" ) || url.StartsWith( "https:" )
|| url.StartsWith( "file:" ) )
{
wxString menuText = wxString::Format( _( "Open %s" ), url );
wxString href = url;
if( m_project )
href = ResolveUriByEnvVars( url, m_project );
if( url.StartsWith( "file:" ) )
href = NormalizeFileUri( href );
wxString menuText = wxString::Format( _( "Open %s" ), href );
js += wxString::Format( wxT( "[\"%s\", \"%s\"],\n" ),
EscapeString( menuText, CTX_JS_STR ),
EscapeString( url, CTX_JS_STR ) );
EscapeString( href, CTX_JS_STR ),
EscapeString( href, CTX_JS_STR ) );
}
}
@@ -1413,6 +1442,7 @@ function ShM(aEntries) {
var cChoice = app.popUpMenuEx.apply(app, aParams);
if (cChoice != null && cChoice.substring(0, 1) == '#') this.pageNum = parseInt(cChoice.slice(1));
else if (cChoice != null && cChoice.substring(0, 4) == 'http') app.launchURL(cChoice);
else if (cChoice != null && cChoice.substring(0, 4) == 'file') app.openDoc(cChoice.substring(7));
}
)JS";
@@ -1634,7 +1664,7 @@ void PDF_PLOTTER::Text( const VECTOR2I& aPos,
coordinate system will be used for the overlining. Also the %f
for the trig part of the matrix to avoid %g going in exponential
format (which is not supported) */
fprintf( m_workFile, "q %f %f %f %f %g %g cm BT %s %g Tf %d Tr %g Tz ",
fprintf( m_workFile, "q %f %f %f %f %f %f cm BT %s %g Tf %d Tr %g Tz ",
ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f,
fontname, heightFactor, render_mode, wideningFactor * 100 );
+3 -2
View File
@@ -162,7 +162,8 @@ static wxString XmlEsc( const wxString& aStr, bool isAttribute = false )
}
SVG_PLOTTER::SVG_PLOTTER()
SVG_PLOTTER::SVG_PLOTTER( const PROJECT* aProject ) :
PSLIKE_PLOTTER( aProject )
{
m_graphics_changed = true;
SetTextMode( PLOT_TEXT_MODE::STROKE );
@@ -851,7 +852,7 @@ void SVG_PLOTTER::Text( const VECTOR2I& aPos,
fprintf( m_outputFile,
"textLength=\"%.*f\" font-size=\"%.*f\" lengthAdjust=\"spacingAndGlyphs\"\n"
"text-anchor=\"%s\" opacity=\"0\">%s</text>\n",
"text-anchor=\"%s\" opacity=\"0\" stroke-opacity=\"0\">%s</text>\n",
m_precision, sz_dev.x, m_precision, sz_dev.y, hjust, TO_UTF8( XmlEsc( aText ) ) );
if( !aOrient.IsZero() )
+3 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -44,7 +44,8 @@
#include <callback_gal.h>
#include <math/util.h> // for KiROUND
PLOTTER::PLOTTER( )
PLOTTER::PLOTTER( const PROJECT* aProject ) :
m_project( aProject )
{
m_plotScale = 1;
m_currentPenWidth = -1; // To-be-set marker
+9 -4
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.TXT for contributors.
* Copyright (C) 2024 KiCad Developers, see AUTHORS.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -55,9 +55,12 @@ RENDER_SETTINGS::~RENDER_SETTINGS()
#if 0
constexpr double correction = 0.8; // Looks best visually
constexpr double correction = 0.8; // Looks best visually
#else
constexpr double correction = 1.0; // Matches ISO 128-2
constexpr double correction = 1.0; // Matches ISO 128-2, but can creates issues on GTK and MSW:
// "dots" are not always visible depending on the zoom level
// because they create 0 lenght lines
// So they will drawn as segments, even with correction = 1.0
#endif
@@ -69,7 +72,9 @@ double RENDER_SETTINGS::GetDashLength( int aLineWidth ) const
double RENDER_SETTINGS::GetDotLength( int aLineWidth ) const
{
return ( 1.0 - correction ) * aLineWidth;
// The minimal length scale is arbitrary set to 0.2 after trials
// 0 lenght can create drawing issues
return std::max( ( 1.0 - correction ), 0.2 ) * aLineWidth;
}
+37 -6
View File
@@ -42,6 +42,13 @@ REPORTER& REPORTER::Report( const char* aText, SEVERITY aSeverity )
}
bool REPORTER::HasMessageOfSeverity( int aSeverityMask ) const
{
wxFAIL_MSG( "HasMessageOfSeverity is not implemented in this reporter" );
return HasMessage();
}
REPORTER& WX_TEXT_CTRL_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
{
wxCHECK_MSG( m_textCtrl != nullptr, *this,
@@ -60,17 +67,34 @@ bool WX_TEXT_CTRL_REPORTER::HasMessage() const
REPORTER& WX_STRING_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
{
wxCHECK_MSG( m_string != nullptr, *this,
wxT( "No wxString object defined in WX_STRING_REPORTER." ) );
*m_string << aText << wxS( "\n" );
m_severityMask |= aSeverity;
m_string << aText << wxS( "\n" );
return *this;
}
const wxString& WX_STRING_REPORTER::GetMessages() const
{
return m_string;
}
void WX_STRING_REPORTER::Clear()
{
m_severityMask = 0;
m_string.clear();
}
bool WX_STRING_REPORTER::HasMessage() const
{
return !m_string->IsEmpty();
return !m_string.IsEmpty();
}
bool WX_STRING_REPORTER::HasMessageOfSeverity( int aSeverityMask ) const
{
return ( m_severityMask & aSeverityMask ) != 0;
}
@@ -106,7 +130,14 @@ REPORTER& WX_HTML_PANEL_REPORTER::ReportHead( const wxString& aText, SEVERITY aS
bool WX_HTML_PANEL_REPORTER::HasMessage() const
{
return m_panel->Count( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) > 0;
// Check just for errors and warnings for compatibility
return HasMessageOfSeverity( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING );
}
bool WX_HTML_PANEL_REPORTER::HasMessageOfSeverity( int aSeverityMask ) const
{
return m_panel->Count( aSeverityMask ) > 0;
}
+3
View File
@@ -160,6 +160,9 @@ APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaV
m_params.emplace_back( new PARAM<int>( "system.last_imperial_units",
&m_System.last_imperial_units, static_cast<int>( EDA_UNITS::MILS ) ) );
m_params.emplace_back( new PARAM<bool>( "system.show_import_issues",
&m_System.show_import_issues, true ) );
m_params.emplace_back( new PARAM<wxString>( "appearance.color_theme",
&m_ColorTheme, COLOR_SETTINGS::COLOR_BUILTIN_DEFAULT ) );
+1 -1
View File
@@ -36,7 +36,7 @@ const wxString COLOR_SETTINGS::COLOR_BUILTIN_CLASSIC = "_builtin_classic";
COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath ) :
JSON_SETTINGS( std::move( aFilename ), SETTINGS_LOC::COLORS, colorsSchemaVersion ),
JSON_SETTINGS( aFilename, SETTINGS_LOC::COLORS, colorsSchemaVersion ),
m_overrideSchItemColors( false )
{
if( aAbsolutePath )
+2 -1
View File
@@ -116,7 +116,7 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
m_params.emplace_back( new PARAM<int>( "auto_backup.min_interval",
&m_Backup.min_interval, 300 ) );
m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "environment.vars",
auto envVarsParam = m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "environment.vars",
[&]() -> nlohmann::json
{
nlohmann::json ret = {};
@@ -212,6 +212,7 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
}
},
{} ) );
envVarsParam->SetClearUnknownKeys();
m_params.emplace_back( new PARAM<bool>( "input.focus_follow_sch_pcb",
&m_Input.focus_follow_sch_pcb, false ) );
+14 -8
View File
@@ -75,6 +75,7 @@ JSON_SETTINGS::JSON_SETTINGS( const wxString& aFilename, SETTINGS_LOC aLocation,
m_createIfMissing( aCreateIfMissing ),
m_createIfDefault( aCreateIfDefault ),
m_writeFile( aWriteFile ),
m_modified( false ),
m_deleteLegacyAfterMigration( true ),
m_resetParamsIfMissing( true ),
m_schemaVersion( aSchemaVersion ),
@@ -353,6 +354,8 @@ bool JSON_SETTINGS::LoadFromFile( const wxString& aDirectory )
wxLogTrace( traceSettings, wxT( "Loaded <%s> with schema %d" ), GetFullFilename(),
m_schemaVersion );
m_modified = false;
// If we migrated, clean up the legacy file (with no extension)
if( m_writeFile && ( legacy_migrated || migrated ) )
{
@@ -373,15 +376,13 @@ bool JSON_SETTINGS::LoadFromFile( const wxString& aDirectory )
bool JSON_SETTINGS::Store()
{
bool modified = false;
for( PARAM_BASE* param : m_params )
{
modified |= !param->MatchesFile( this );
m_modified |= !param->MatchesFile( this );
param->Store( this );
}
return modified;
return m_modified;
}
@@ -469,10 +470,12 @@ bool JSON_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
for( PARAM_BASE* param : m_params )
{
if( PARAM_WXSTRING_MAP* stringMap = dynamic_cast<PARAM_WXSTRING_MAP*>( param ) )
if( param->ClearUnknownKeys() )
{
if( stringMap->ClearUnknownKeys() )
toSave[ stringMap->GetJsonPath() ] = nlohmann::json( {} );
nlohmann::json_pointer p
= JSON_SETTINGS_INTERNALS::PointerFromString( param->GetJsonPath() );
toSave[p] = nlohmann::json( {} );
}
}
@@ -504,6 +507,9 @@ bool JSON_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
success = false;
}
if( success )
m_modified = false;
return success;
}
@@ -858,7 +864,7 @@ void JSON_SETTINGS::ReleaseNestedSettings( NESTED_SETTINGS* aSettings )
if( it != m_nested_settings.end() )
{
wxLogTrace( traceSettings, wxT( "Flush and release %s" ), ( *it )->GetFilename() );
( *it )->SaveToFile();
m_modified |= ( *it )->SaveToFile();
m_nested_settings.erase( it );
}
+100 -22
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -28,11 +28,15 @@
#include <clocale>
#include <cmath>
#include <map>
#include <core/map_helpers.h>
#include <fmt/core.h>
#include <macros.h>
#include <richio.h> // StrPrintf
#include <string_utils.h>
#include <wx_filename.h>
#include <fmt/chrono.h>
#include <wx/log.h>
#include <wx/regex.h>
#include "locale_io.h"
@@ -42,7 +46,35 @@
* platforms. This is the list of illegal file name characters for Windows which includes
* the illegal file name characters for Linux and OSX.
*/
static const char illegalFileNameChars[] = "\\/:\"<>|";
static const char illegalFileNameChars[] = "\\/:\"<>|*?";
// Checks if a full filename is valid, i.e. does not contains illegal chars
bool IsFullFileNameValid( const wxString& aFullFilename )
{
// Test for forbidden chars in aFullFilename.
// '\'and '/' are allowed here because aFullFilename can be a full path, and
// ':' is allowed on Windows as second char in string.
// So remove allowed separators from string to test
wxString filtered_fullpath = aFullFilename;
#ifdef __WINDOWS__
// On MSW, the list returned by wxFileName::GetForbiddenChars() contains separators
// '\'and '/'
filtered_fullpath.Replace( "/", "_" );
filtered_fullpath.Replace( "\\", "_" );
// A disk identifier is allowed, and therefore remove its separator
if( filtered_fullpath.Length() > 1 && filtered_fullpath[1] == ':' )
filtered_fullpath[1] = ' ';
#endif
if( wxString::npos != filtered_fullpath.find_first_of( wxFileName::GetForbiddenChars() ) )
return false;
return true;
}
wxString ConvertToNewOverbarNotation( const wxString& aOldStr )
@@ -540,22 +572,32 @@ wxString UnescapeHTML( const wxString& aString )
{
wxString converted = aString;
converted.Replace( wxS( "&quot;" ), wxS( "\"" ) );
converted.Replace( wxS( "&apos;" ), wxS( "'" ) );
converted.Replace( wxS( "&amp;" ), wxS( "&" ) );
converted.Replace( wxS( "&lt;" ), wxS( "<" ) );
converted.Replace( wxS( "&gt;" ), wxS( ">" ) );
// clang-format off
static const std::map<wxString, wxString> c_replacements = {
{ wxS( "quot" ), wxS( "\"" ) },
{ wxS( "apos" ), wxS( "'" ) },
{ wxS( "amp" ), wxS( "&" ) },
{ wxS( "lt" ), wxS( "<" ) },
{ wxS( "gt" ), wxS( ">" ) }
};
// clang-format on
// Yes, &amp;#123; is going to give unexpected results.
// Construct regex
wxString regexStr = "&(#(\\d*)|#x([a-zA-Z0-9]{4})";
wxString result;
for( auto& [key, value] : c_replacements )
regexStr << '|' << key;
wxRegEx regex( "&#(\\d*);" );
regexStr << ");";
wxRegEx regex( regexStr );
// Process matches
size_t start = 0;
size_t len = 0;
wxString str = aString;
wxString result;
wxString str = converted;
while( regex.Matches( str ) )
{
@@ -564,12 +606,26 @@ wxString UnescapeHTML( const wxString& aString )
result << str.Left( start );
unsigned long codeVal = 0;
wxString code = regex.GetMatch( str, 1 );
code.ToCULong( &codeVal );
wxString code = regex.GetMatch( str, 1 );
wxString codeDec = regex.GetMatch( str, 2 );
wxString codeHex = regex.GetMatch( str, 3 );
if( codeVal != 0 )
result << wxUniChar( codeVal );
if( !codeDec.IsEmpty() || !codeHex.IsEmpty() )
{
unsigned long codeVal = 0;
if( !codeDec.IsEmpty() )
codeDec.ToCULong( &codeVal );
else if( !codeHex.IsEmpty() )
codeHex.ToCULong( &codeVal, 16 );
if( codeVal != 0 )
result << wxUniChar( codeVal );
}
else if( auto val = get_opt( c_replacements, code ) )
{
result << *val;
}
str = str.Mid( start + len );
}
@@ -591,7 +647,7 @@ wxString RemoveHTMLTags( const wxString& aInput )
wxString LinkifyHTML( wxString aStr )
{
wxRegEx regex( wxS( "\\b(https?|ftp|file)://([-\\w+&@#/%?=~|!:,.;]*[^.<>\\s\u00b6])" ),
wxRegEx regex( wxS( "\\b(https?|ftp|file)://([-\\w+&@#/%?=~|!:,.;]*[^.,:;<>\\s\u00b6])" ),
wxRE_ICASE );
regex.ReplaceAll( &aStr, "<a href=\"\\0\">\\0</a>" );
@@ -907,11 +963,12 @@ bool ApplyModifier( double& value, const wxString& aString )
}
if( units.length()
&& !units.CmpNoCase( wxT( "F" ) )
&& !units.CmpNoCase( wxT( "hz" ) )
&& !units.CmpNoCase( wxT( "W" ) )
&& !units.CmpNoCase( wxT( "V" ) )
&& !units.CmpNoCase( wxT( "H" ) ) )
&& !units.IsSameAs( wxT( "F" ), false )
&& !units.IsSameAs( wxT( "hz" ), false )
&& !units.IsSameAs( wxT( "W" ), false )
&& !units.IsSameAs( wxT( "V" ), false )
&& !units.IsSameAs( wxT( "A" ), false )
&& !units.IsSameAs( wxT( "H" ), false ) )
{
return false;
}
@@ -1399,3 +1456,24 @@ wxString From_UTF8( const std::string& aString )
return line;
}
wxString NormalizeFileUri( const wxString& aFileUri )
{
wxString uriPathAndFileName;
wxCHECK( aFileUri.StartsWith( wxS( "file://" ), &uriPathAndFileName ), aFileUri );
wxString tmp = uriPathAndFileName;
wxString retv = wxS( "file://" );
tmp.Replace( wxS( "\\" ), wxS( "/" ) );
tmp.Replace( wxS( ":" ), wxS( "" ) );
if( !tmp.IsEmpty() && tmp[0] != '/' )
tmp = wxS( "/" ) + tmp;
retv += tmp;
return retv;
}
+8 -6
View File
@@ -48,7 +48,7 @@ ACTION_MANAGER::ACTION_MANAGER( TOOL_MANAGER* aToolManager ) :
std::string groupName = "none";
std::optional<TOOL_ACTION_GROUP> group = action->GetActionGroup();
if( group.has_value() )
{
groupID = group.value().GetGroupID();
@@ -152,19 +152,21 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const
// If no luck, try without Shift, to handle keys that require it
// e.g. to get ? you need to press Shift+/ without US keyboard layout
// Hardcoding ? as Shift+/ is a bad idea, as on another layout you may need to press a
// different combination
if( it == m_actionHotKeys.end() )
// different combination.
// This doesn't apply for letters, as we already handled case normalisation.
if( it == m_actionHotKeys.end() && !std::isalpha( key ) )
{
wxLogTrace( kicadTraceToolStack,
wxS( "ACTION_MANAGER::RunHotKey No actions found, searching with key: %s" ),
KeyNameFromKeyCode( key | ( mod & ~MD_SHIFT ) ) );
it = m_actionHotKeys.find( key | ( mod & ~MD_SHIFT ) );
if( it == m_actionHotKeys.end() )
return false; // no appropriate action found for the hotkey
}
// Still no luck, we're done without a match
if( it == m_actionHotKeys.end() )
return false; // no appropriate action found for the hotkey
const std::list<TOOL_ACTION*>& actions = it->second;
// Choose the action that has the highest priority on the active tools stack
+15
View File
@@ -212,6 +212,21 @@ ACTION_TOOLBAR::ACTION_TOOLBAR( EDA_BASE_FRAME* parent, wxWindowID id, const wxP
ACTION_TOOLBAR::~ACTION_TOOLBAR()
{
Disconnect( wxEVT_COMMAND_TOOL_CLICKED, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolEvent ),
nullptr, this );
Disconnect( wxEVT_AUITOOLBAR_RIGHT_CLICK,
wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolRightClick ), nullptr, this );
Disconnect( wxEVT_AUITOOLBAR_BEGIN_DRAG, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onItemDrag ),
nullptr, this );
Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( ACTION_TOOLBAR::onMouseClick ), nullptr,
this );
Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( ACTION_TOOLBAR::onMouseClick ), nullptr, this );
Disconnect( m_paletteTimer->GetId(), wxEVT_TIMER,
wxTimerEventHandler( ACTION_TOOLBAR::onTimerDone ), nullptr, this );
Unbind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( ACTION_TOOLBAR::onThemeChanged ), this );
delete m_paletteTimer;
// Clear all the maps keeping track of our items on the toolbar
+1 -1
View File
@@ -130,7 +130,7 @@ VECTOR2I SELECTION::GetCenter() const
}
BOX2I SELECTION::GetBoundingBox() const
BOX2I SELECTION::GetBoundingBox( bool aOnlyVisible ) const
{
BOX2I bbox;
+4 -1
View File
@@ -455,8 +455,11 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
if( isMouseClick( type ) )
{
if( m_toolMgr->GetToolHolder() && m_toolMgr->GetToolHolder()->GetToolCanvas() )
if( m_toolMgr->GetToolHolder() && m_toolMgr->GetToolHolder()->GetToolCanvas() &&
!m_toolMgr->GetToolHolder()->GetToolCanvas()->HasFocus() )
{
m_toolMgr->GetToolHolder()->GetToolCanvas()->SetFocus();
}
}
// Mouse handling
+5 -1
View File
@@ -362,7 +362,11 @@ bool TOOL_MANAGER::doRunAction( const TOOL_ACTION& aAction, bool aNow, const std
while( synchronousControl == STS_RUNNING )
{
wxYield();
wxYield(); // Needed to honor mouse (and other) events during editing
wxMilliSleep( 1 ); // Needed to avoid 100% use of one cpu core.
// The sleeping time must be must be small to avoid
// noticeable lag in mouse and editing events
// (1 to 5 ms is a good value)
}
retVal = synchronousControl != STS_CANCELLED;
+18 -34
View File
@@ -38,35 +38,8 @@
#include <wx/textentry.h>
#include <wx/log.h>
#include <wx/combo.h>
GRID_CELL_TEXT_EDITOR::GRID_CELL_TEXT_EDITOR() : wxGridCellTextEditor()
{
}
void GRID_CELL_TEXT_EDITOR::SetValidator( const wxValidator& validator )
{
// keep our own copy because wxGridCellTextEditor's is annoyingly private
m_validator.reset( static_cast<wxValidator*>( validator.Clone() ) );
wxGridCellTextEditor::SetValidator( *m_validator );
}
void GRID_CELL_TEXT_EDITOR::StartingKey( wxKeyEvent& event )
{
if( m_validator )
{
m_validator.get()->SetWindow( Text() );
m_validator.get()->ProcessEvent( event );
}
if( event.GetSkipped() )
{
wxGridCellTextEditor::StartingKey( event );
event.Skip( false );
}
}
#include <wx/msgdlg.h>
#include <refdes_utils.h>
FOOTPRINT_NAME_VALIDATOR::FOOTPRINT_NAME_VALIDATOR( wxString* aValue ) :
@@ -384,18 +357,24 @@ bool FIELD_VALIDATOR::Validate( wxWindow* aParent )
return false;
wxString val( text->GetValue() );
return DoValidate( val, aParent );
}
bool FIELD_VALIDATOR::DoValidate( const wxString& aValue, wxWindow* aParent )
{
wxString msg;
if( HasFlag( wxFILTER_EMPTY ) && val.empty() )
if( HasFlag( wxFILTER_EMPTY ) && aValue.empty() )
msg.Printf( _( "The value of the field cannot be empty." ) );
if( HasFlag( wxFILTER_EXCLUDE_CHAR_LIST ) && ContainsExcludedCharacters( val ) )
if( HasFlag( wxFILTER_EXCLUDE_CHAR_LIST ) && ContainsExcludedCharacters( aValue ) )
{
wxArrayString badCharsFound;
for( const wxUniCharRef& excludeChar : GetCharExcludes() )
{
if( val.Find( excludeChar ) != wxNOT_FOUND )
if( aValue.Find( excludeChar ) != wxNOT_FOUND )
{
if( excludeChar == '\r' )
badCharsFound.Add( _( "carriage return" ) );
@@ -463,14 +442,19 @@ bool FIELD_VALIDATOR::Validate( wxWindow* aParent )
break;
};
}
else if( m_fieldId == REFERENCE_FIELD && val.Contains( wxT( "${" ) ) )
else if( m_fieldId == REFERENCE_FIELD && aValue.Contains( wxT( "${" ) ) )
{
msg.Printf( _( "The reference designator cannot contain text variable references" ) );
}
else if( m_fieldId == REFERENCE_FIELD && UTIL::GetRefDesPrefix( aValue ).IsEmpty() )
{
msg.Printf( _( "References must start with a letter." ) );
}
if( !msg.empty() )
{
m_validatorWindow->SetFocus();
if( m_validatorWindow )
m_validatorWindow->SetFocus();
wxMessageBox( msg, _( "Field Validation Error" ), wxOK | wxICON_EXCLAMATION, aParent );
+25 -25
View File
@@ -399,35 +399,19 @@ void VIEW::SetRequired( int aLayerId, int aRequiredId, bool aRequired )
}
// stupid C++... python lambda would do this in one line
template <class CONTAINER>
struct QUERY_VISITOR
{
typedef typename CONTAINER::value_type item_type;
QUERY_VISITOR( CONTAINER& aCont, int aLayer ) :
m_cont( aCont ), m_layer( aLayer )
{
}
bool operator()( VIEW_ITEM* aItem )
{
if( aItem->viewPrivData()->GetFlags() & VISIBLE )
m_cont.push_back( VIEW::LAYER_ITEM_PAIR( aItem, m_layer ) );
return true;
}
CONTAINER& m_cont;
int m_layer;
};
int VIEW::Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) const
{
if( m_orderedLayers.empty() )
return 0;
int layer = UNDEFINED_LAYER;
auto visitor =
[&]( VIEW_ITEM* item ) -> bool
{
aResult.push_back( VIEW::LAYER_ITEM_PAIR( item, layer ) );
return true;
};
std::vector<VIEW_LAYER*>::const_reverse_iterator i;
// execute queries in reverse direction, so that items that are on the top of
@@ -438,7 +422,7 @@ int VIEW::Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) con
if( ( *i )->displayOnly || !( *i )->visible )
continue;
QUERY_VISITOR<std::vector<LAYER_ITEM_PAIR> > visitor( aResult, ( *i )->id );
layer = ( *i )->id;
( *i )->items->Query( aRect, visitor );
}
@@ -446,6 +430,22 @@ int VIEW::Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) con
}
void VIEW::Query( const BOX2I& aRect, const std::function<bool( VIEW_ITEM* )>& aFunc ) const
{
if( m_orderedLayers.empty() )
return;
for( const auto& i : m_orderedLayers )
{
// ignore layers that do not contain actual items (i.e. the selection box, menus, floats)
if( i->displayOnly || !i->visible )
continue;
i->items->Query( aRect, aFunc );
}
}
VECTOR2D VIEW::ToWorld( const VECTOR2D& aCoord, bool aAbsolute ) const
{
const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix();
+6 -2
View File
@@ -45,7 +45,7 @@
#include <wx/log.h>
#ifdef __WXMSW__
#define USE_MOUSE_CAPTURE
#define USE_MOUSE_CAPTURE
#endif
using namespace KIGFX;
@@ -694,7 +694,11 @@ void WX_VIEW_CONTROLS::CaptureCursor( bool aEnabled )
// Note: for some reason, m_parentPanel->HasCapture() can be false even if CaptureMouse()
// was called (i.e. mouse was captured, so when need to test m_MouseCapturedLost to be
// sure a wxEVT_MOUSE_CAPTURE_LOST event was fired before. Otherwise wxMSW complains
if( aEnabled && !m_parentPanel->HasCapture() && m_parentPanel->m_MouseCapturedLost )
// The IsModalDialogFocused is checked because it's possible to start a capture
// due to event ordering while a modal dialog was just opened, the mouse capture steels focus
// from the modal and causes odd behavior
if( aEnabled && !m_parentPanel->HasCapture() && m_parentPanel->m_MouseCapturedLost
&& !KIUI::IsModalDialogFocused() )
{
m_parentPanel->CaptureMouse();

Some files were not shown because too many files have changed in this diff Show More