Commit Graph

8298 Commits

Author SHA1 Message Date
Jeff Young f41f04b301 Hook up AddField handler to GRID_TRICKS for SCH dialogs.
Fixes https://gitlab.com/kicad/code/kicad/issues/git/14153
2023-03-02 18:17:41 +00:00
Wayne Stambaugh 789bf6455a Coverity fixes and code cleaning. 2023-03-02 09:04:47 -05:00
Salvador E. Tropea a6b1a09edf Fix rounding errors in gerber files
The userToDeviceCoordinates helper returns a VECTOR2D
Converting it to VECTOR2I back and forth is a bug and generates rounding errors
Cherry picked from stable branch
2023-02-28 20:27:16 +01:00
Johannes Pfister a87550a2c6 When importing legacy PCB dimension: Use automatic dimension when Unit couldn't be determined 2023-02-28 11:59:47 +00:00
Roberto Fernandez Bautista b03366c9e8 Fix CADSTAR importer memory leaks
We were leaking the xml tree when throwing exceptions
2023-02-27 23:57:39 +01:00
jean-pierre charras 8b47c94f6e PANEL_COLOR_SETTINGS: swap swatches and texts to avoid annoying truncation.
In some languages, the texts can be long, and create truncation of the left
column. So if the left column shows swatches they are truncated, or not visible
Truncating long texts is less annoying.
Fixes #14052
https://gitlab.com/kicad/code/kicad/issues/14052
2023-02-27 08:35:35 +01:00
Jeff Young fe9370ceea Don't allocate all of memory when the coord system turns inside out.
Fixes https://gitlab.com/kicad/code/kicad/issues/14088
2023-02-26 21:53:05 +00:00
Roberto Fernandez Bautista 698d0b7e92 CADSTAR Sch: Fix loading of graphical arc shapes
Correctly load arc shapes as real arcs instead of approximating now that
v7 supports graphical arcs in the schematic.

Also fix calculation of arc geometry for ccw arcs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14101
2023-02-26 19:46:34 +01:00
jean-pierre charras 51d46c0e73 plotters rework: add plot fct to use TEXT_ATTRIBUTES class to pass text settings
Old PLOTTER::Text is not (yet) removed, but it use negative text size
to mirrored text, which is not really compatible with some plotters (especially PDF).
Using TEXT_ATTRIBUTES is much easy and much better,
so PLOTTER::PlotText() is added.
Note: "old" PLOTTER::Text() is not removed yet.
2023-02-26 14:44:53 +01:00
jean-pierre charras bbfc5c272e Fix my commit d07738a06c.
( a DC->SetPen() was deleted by mistake)
2023-02-25 19:06:46 +01:00
jean-pierre charras ece34e1a0c Plot Gerber format: ensure all attributes are added to polygon items.
Especially, TA.AperFunction,EtchedComponent for net tie footprints using polygons.
2023-02-25 19:06:46 +01:00
Jeff Young 9a0aeb4344 Adjust AC-small-signal plot names when saving placeholders.
Fixes https://gitlab.com/kicad/code/kicad/issues/14016
2023-02-25 13:26:33 +00:00
Jeff Young ee956673b1 Respect readOnly cells in GRID_TRICKS.
Also fixes setting colors in the signals grid as it allows us to make
it editable again.

Fixes https://gitlab.com/kicad/code/kicad/issues/14079
2023-02-25 11:02:12 +00:00
Seth Hillbrand bce402a01c Revert font spacing/tabs to the v6 model
While convoluted, this model matches as best we have found so far, the
alignment with scintilla.  The spacing is character size for N-1 of the
characters in the 4-space tab stops.  The final character is sized for
the actual space character in the stroke font (0.761905)

Fixes https://gitlab.com/kicad/code/kicad/issues/13791
2023-02-24 17:15:57 -08:00
Jeff Young 65a10bd425 Remove unused member variable. 2023-02-24 22:43:23 +00:00
Jeff Young 150d2fd281 Tweak the Mac default selection highlight color for better visibility. 2023-02-24 12:44:55 +00:00
Jeff Young 4bb508eacf Adjust stroke font baseline offset to better match 6.0.
Fixes https://gitlab.com/kicad/code/kicad/issues/13886
2023-02-24 12:44:55 +00:00
Jon Evans 1651b44ab1 Fix some PCB_SHAPE properties
Hide irrelevant position/start/end properties
for shape classes that don't use them.
2023-02-23 20:23:44 -05:00
Seth Hillbrand 81256c0fa4 Prevent mutex deadlock
The overbar function in outline fonts recursively calls the text
function which already owns the lock.  To avoid this, we have an
unlocked variant that is wrapped by the exposed text function

Fixes https://gitlab.com/kicad/code/kicad/issues/14015
2023-02-23 14:59:59 -08:00
jean-pierre charras bc8a78c6df Eeschema plot: honor B&W plot option for bitmap images.
Fixes #14013
https://gitlab.com/kicad/code/kicad/issues/14013
2023-02-23 09:50:05 +01:00
Jon Evans f076f6fb46 Preserve unknown keys in JSON_SETTINGS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13847
2023-02-22 19:00:47 -05:00
jean-pierre charras dce8826eb2 Fix incorrect tilt of italic texts when plotting them.
Fixes #14023
https://gitlab.com/kicad/code/kicad/issues/14023
2023-02-22 16:55:20 +01:00
Jon Evans 43d3a18b86 Improve HiDPI handling of appearance/layer controls 2023-02-22 09:20:36 -05:00
Jon Evans 89ef6b36f4 Fix layer widget in HiDPI situations 2023-02-22 09:20:30 -05:00
Salvador E. Tropea 915446a472 Create the built-in colors in the constructor
This is needed so Python scripts can get built-in colors using the
SETTINGS_MANAGER.GetColorSettings() member.
Otherwise calling it with a built-in name crashes.


(cherry picked from commit aee6d9d01c)
2023-02-22 12:52:44 +00:00
jean-pierre charras 814dcdab31 Fix compatibility with wxWidgetsversion < 3.1.6 2023-02-22 10:05:37 +01:00
Ian McInerney be19e967dc Remove WX_COMPATIBILITY flag
Some classes had been originally designed to be usable separate from wx,
but over time our uses of the classes have become entertwined with wx
features (e.g. colors), and various changes have also leaked wx into the
classes unguarded. So just remove the option to hide wx in those classes
to simplify the code.
2023-02-22 01:44:06 +00:00
Ian McInerney 0ba116a3ee Remove unused functions from COLOR4D 2023-02-22 01:44:06 +00:00
Ian McInerney bcb93e9aa7 Modernize setting of compiler definitions in CMake
add_compile_definitions was added in 3.12, and our minimum is now
greater than that.
2023-02-22 01:44:06 +00:00
Marek Roszko 39e69a3d29 Fix up handling of font names available in multiple names
ttf fonts can declare multiple language names. Many by default opt to just declare one and not tag it any particular language.
However, there are CJK languages that typically leverage this function the most. They'll tag both a "en" and a cjk lang family name in CJK characters.

To be as user friendly as possible, we need to display said fonts in the CJK languages if KiCad to set to such a locale.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14011
2023-02-21 20:26:41 -05:00
jean-pierre charras d07738a06c gr_basic.cpp: ensure a pen with width = 0 is transparent.
Setting its color to COLOR4D::UNSPECIFIED (i.e. opacity = 0) is not enough
for all  platforms (i.e. Windows)
2023-02-21 20:06:54 +01:00
Jeff Young 6fcb95b24e ADDED user-defined signals. 2023-02-21 13:32:01 +00:00
Jeff Young ae0cf19923 Nullptr safety. 2023-02-21 13:32:01 +00:00
Jeff Young 87eb4401e3 Add Scintilla support to WX_GRID. 2023-02-21 13:32:01 +00:00
jean-pierre charras b05b33a9ff Fix a compil issue with gcc12.2 and Coverity warnings. 2023-02-21 11:54:38 +01:00
Mark Roszko 365c7be4ed Fix symbol contributor link 2023-02-20 19:44:37 +00:00
jean-pierre charras 31be74b8b3 Fix a few Coverity warnings 2023-02-20 09:25:01 +01:00
Marek Roszko 343e3aee55 Remove unused m_sockets 2023-02-19 23:49:43 -05:00
Marek Roszko 30a49462fe Fix crash parsing cadstar
Fixes sentry KICAD-B2
2023-02-19 08:06:35 -05:00
Marek Roszko c5a2c9c773 Try to prevent a crash in mpFXY::Plot
Fixes sentry kicad-c0
2023-02-19 00:38:42 -05:00
Marek Roszko d55e2049e5 Silence some warnings with static_casts 2023-02-18 23:36:50 -05:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Marek Roszko dffd2da8c8 Fix the shared_lock added and micro-opt the reindex 2023-02-18 11:28:19 -05:00
Marek Roszko e053fbefd7 Use a shared_mutex to read/write lock the nickIndex
Fixes sentry kicad-ax
2023-02-18 10:17:58 -05:00
Jon Evans f7d59f2e89 Enable properties panel in footprint editor 2023-02-17 20:35:56 -05:00
qu1ck 2975f53647 PCM: auto reload global libs after dialog is run
This adds Reset() method to KIFACE to reload global libs stored in
global static vars.
Also refactors some lib reload code in various frames to have
common MAIL_RELOAD_LIB handler.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12500
2023-02-17 17:24:32 +00:00
Mark Roszko 7b4abb1f7b FT_Face is also not thread, protect getTextAsGlyphs 2023-02-17 14:39:52 +00:00
Marek Roszko 65d5b34da3 freetype is not thread safe, zone filler can trigger multi-thread access
sentry KICAD-B1

https://freetype.org/freetype2/docs/reference/ft2-base_interface.html
[Since 2.5.6] In multi-threaded applications it is easiest to use one FT_Library object per thread.
In case this is too cumbersome, a single FT_Library object across threads is possible also, as long as a mutex lock is used around FT_New_Face and FT_Done_Face.
2023-02-17 07:26:52 -05:00
Seth Hillbrand 576bef4ba0 Fix Ukrainian language name
Should refer to the language not to a Ukrainian person
2023-02-16 15:10:47 -08:00
Seth Hillbrand 5c1b15f8e3 Make LIB_TREE_NODE sort irreflexive
std::sort requires explicit ordering of all elements.  It does not allow
for equality in its output
2023-02-16 13:00:18 -08:00