70 Commits

Author SHA1 Message Date
Seth Hillbrand c9f5cbfae7 Fix autoplace fields wrong spacing for rotated symbols
The autoplacer used ANGLE_HORIZONTAL when computing field bounding boxes
for sizing, regardless of symbol orientation. For 90/270-degree rotated
symbols, GetBoundingBox() applies both the field angle and the symbol
transform, so HORIZONTAL + 90-degree transform = 90-degree net rotation,
swapping width and height. This caused field vertical spacing to be based
on text width instead of text height, producing fields that were too
spread out vertically and sometimes overlapping the symbol body.

The fix computes the display angle once (VERTICAL for 90/270, HORIZONTAL
for 0/180) and uses it consistently for both sizing and final field angle
assignment. With the display angle, the net rotation for 90/270 symbols
is 180 degrees (VERTICAL + 90-degree transform), which preserves native
text dimensions after normalization.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23032
2026-02-15 11:17:44 -08:00
Seth Hillbrand eaa31f9714 Fix autoplace fields rotating text on 90/270-degree symbols
Commit 7d1f3a2161 fixed field overlap (issue #16538) by always setting
field angle to HORIZONTAL during autoplace. However, it set this angle
permanently, causing fields on rotated symbols to display vertically
instead of horizontally (since the symbol's transform rotates the text).

The fix separates bounding box computation from final angle assignment.
GetBoundingBox() still uses HORIZONTAL angle (correct for sizing), but
the original angle is restored afterward. The final display angle is set
in DoAutoplace(): VERTICAL for 90/270 rotated symbols (counteracting
the symbol transform) and HORIZONTAL for non-rotated symbols.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22927
2026-02-05 10:11:48 -08:00
Seth Hillbrand 7d1f3a2161 Fix autoplace fields overlapping symbol body for rotated symbols
The autoplace algorithm was incorrectly setting field text angles for
90/270 degree rotated symbols. It set ANGLE_VERTICAL, but GetBoundingBox()
applies both the field angle AND the symbol transform, resulting in
180-degree effective rotation. This caused incorrect bounding box
dimensions and fields overlapping the symbol body.

The fix sets field text angle to ANGLE_HORIZONTAL for all symbols.
For rotated symbols, the symbol transform alone produces the correct
vertical display orientation.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16538
2026-01-28 14:44:04 -08:00
Seth Hillbrand d2ef6fc1a3 Eeschema: Consider drawing sheet boundary in field autoplacement
The field autoplacement algorithm now detects collisions with the
drawing sheet border when determining which side of a symbol to place
fields. When a field box would extend outside the drawable area
(inside the margins), that side is marked as having a collision,
causing the autoplacer to prefer other sides.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19081
2026-01-09 12:43:25 -08:00
Jeff Young 5996cffabc EE -> SCH (no functional changes) 2025-03-13 13:15:47 +00:00
Jeff Young ba522e782d Remove AUTOPLACE_AUTOADDED.
Make autoplace in the symbol preview based on the global eeschema
flag instead.  (If they have it off, then they had better specify
field positions in the database library.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19247
2025-01-02 14:33:30 +00:00
Jeff Young 76d4ef3971 Implement AutoplaceFields() for LIB_SYMBOL.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19247
2025-01-02 11:03:45 +00:00
Seth Hillbrand 0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Ian McInerney 033ba7228d Don't leave an empty statement body 2024-12-31 00:18:10 +00:00
Jeff Young eee28aa06a Clean up fields autoplacement control architecture.
Also adds a mode for AUTOADDED fields.

Also fixes a couple of bugs where a manual-level autoplaced
symbol would get reset back to auto-level when autoplaced.
2024-12-23 14:30:17 +00:00
Jeff Young 7da8b42206 Push more functionality to SYMBOL.
(This will allow us to run the fields autoplacer on SYMBOLs,
including LIB_SYMBOLs.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19247
2024-12-22 20:21:24 +00:00
John Beard 7214a108e4 Text alignment: add a flip function
Reduces the need for client code to know it can exploit the
enum -1/+1 properties. ToHAlignment provides an explicit
contract for integral conversion, and also doesn't rely on the
int being exactly -1, 0 or 1 (failure to adhere to which would
be UB).
2024-10-08 23:30:50 +08:00
Jeff Young c59ed0bbb7 Flip symbol editor's Y axis to match other editors. 2024-04-27 13:47:56 +01:00
Jeff Young 95136494b3 RIP LIB_PIN. 2024-04-20 12:10:31 +01:00
Martin Berglund ddc2092dac Eeschema: Autoplace fields offset correction
No longer count fields without 'Allow automatic placement'
toward the Autoplace offset.

Fixes https://gitlab.com/kicad/code/kicad/issues/16588
2024-01-24 00:24:16 +00:00
Jon Evans 148e111579 Refactor pin orientation to be an enum class
Add various LIB_PIN properties
2023-07-26 23:46:15 -04:00
Jeff Young 02b380da96 Field bounding boxes no longer contain interline spacing.
That's entirely done through FIELD_PADDING now.

Fixes https://gitlab.com/kicad/code/kicad/issues/14127
2023-05-07 22:24:40 +01:00
Wayne Stambaugh a0d02fbab1 Make multivector.h header order independent.
Attempt to clean up all redundant headers that multivector.h touches.
2023-03-23 13:26:32 -04:00
Marek Roszko d2c0f5fc2a More wxSing 2023-01-16 23:14:38 -05:00
Marek Roszko 61e11d6896 Strip out Mils2Iu 2022-09-16 21:09:27 -04:00
Jon Evans 04f65c6c5c ADDED: Option to disable autoplacement for particular fields
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5767
2022-09-04 13:01:31 -04:00
Jeff Young 9188838e50 RIP EDA_RECT. 2022-08-31 23:57:24 +01:00
Jeff Young 2dc6300501 Move EDA_ITEM bounding boxes to BOX2I. 2022-08-31 10:16:55 +01:00
Jeff Young f241617478 Be more careful about non-visible elements in fields autoplacer.
Fixes https://gitlab.com/kicad/code/kicad/issues/10774
2022-02-28 00:18:39 +00:00
Jeff Young e048e51f5d Improve SNR of EDA_ANGLE stuff. 2022-01-14 16:08:18 +00:00
Marek Roszko ea613cf448 Another batch of point changes 2022-01-01 13:17:12 -05:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Marek Roszko 347e03363a Convert wxPoint/wxSize starting from EDA_RECT usages 2022-01-01 11:30:33 -05:00
Jeff Young 86cb57f4a7 Cherry-pick TEXT_ATTRIBUTES and EDA_ANGLE from rockola/kicad-strokefont 2021-12-28 22:15:20 +00:00
Jon Evans 9f6910f1e6 Expand autoplace collision search to include potential field locations
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9762
2021-11-25 07:48:05 -05:00
Jeff Young 18d8053a6c Fix an arithmetic precedence order bug and fine tune autoplacement.
Fixes https://gitlab.com/kicad/code/kicad/issues/9345
2021-11-17 00:49:42 +00:00
Christian Pfluger 9941a52e75 fix for issue #9345 autoplacing in schematic
this fix moves designator fields to the side in case of collision with
symbols or wires.
2021-11-14 18:02:36 +01:00
Jeff Young 552f053a55 Remove pins from symbol hit-testing.
Fixes https://gitlab.com/kicad/code/kicad/issues/8508
2021-09-23 22:07:51 +01:00
Jeff Young b84d1456d5 KIFACE_I -> KIFACE_BASE. 2021-09-14 23:45:14 +01:00
Wayne Stambaugh fbc135e69f Rename SCH_COMPONENT to SCH_SYMBOL. 2021-06-10 10:34:49 -04:00
Jeff Young 2e3860de6f Naming conventions. 2021-05-05 22:58:40 +01:00
Jeff Young afab60ae06 Fixes for autoplace fields.
1) Don't factor in pin names when computing symbol body boundingbox.
2) Grid-snap only in the axis corresponding to the layout side.
3) We only need interline spacing *between* lines, not for each line.
4) Also cleans up the unit checking logic as the unit can't be more
than 0 unless it's a multi-unit symbol.

Fixes https://gitlab.com/kicad/code/kicad/issues/7907
2021-03-15 02:23:29 +00:00
Wayne Stambaugh 1786ae8773 Eeschema: use symbol nomenclature for object file naming. 2021-02-24 08:48:02 -05:00
Jeff Young 360953ba98 "comp" -> "symbol". 2021-01-19 23:50:40 +00:00
Jeff Young 2226e0b7aa Do grid snapping earlier to avoid inconsistencies.
Fixes https://gitlab.com/kicad/code/kicad/issues/5908
2020-12-18 19:57:44 +00:00
Jeff Young 189b1742f7 Naming conventions and formatting. 2020-12-18 19:57:44 +00:00
Jeff Young a9271e43cc Read global fieldNameTemplates for project but don't write them.
Writing responsibility goes to the preferences dialog handler.

Fixes https://gitlab.com/kicad/code/kicad/issues/6450
2020-11-21 23:10:54 +00:00
Marek Roszko 16e3e59495 Split out arrayDim and MIRROR templates from macros.h
These were not macros
2020-11-17 20:21:04 -05:00
Jeff Young 97c34e2516 ADDED alternate pin definitions and assignments.
Fixes https://gitlab.com/kicad/code/kicad/issues/2002
2020-08-21 18:29:36 +01:00
jean-pierre charras 6e47f147aa A few Coverity fixes. 2020-03-30 09:50:26 +02:00
jean-pierre charras cc47062b17 Fix a few Coverity issues 2020-03-23 16:17:22 +01:00
jean-pierre charras 4d9d1a5380 Fix a few compil minor warnings and Coverity minor issues 2020-03-22 09:45:51 +01:00
Jeff Young 93b7eacfb2 Fixup some Coverity issues. 2020-03-21 16:32:22 +00:00
Jeff Young fe3e0307d8 Move sheet name and filename to SCH_FIELD architecture.
Only internal storage architecture has changed (so far).
2020-03-06 16:23:44 +00:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00