This is useful when you want to copy text content out to some
external program (or put it in a text item/box).
I'm not sure it's possible to intuit exactly what a user wants,
as you will often want to copy items as the real items, and sometimes
as text. While KiCad might be able to make a smart guess, external
programs will have no chance!
If the file exists and is not writeable, but the directory
_is_ writable, this check falsely returned true, even
though it will then try to write to a non-writeable file.
When parsing the text we do not yet know if the text is kept aligned or not.
But keep aligned was enabled by default, so the text rotation was incorrect
for texts not aligned.
Come up with a plausible default chamfer size, rather
than prompting every time with a modal (and then you have
to handle when the chanfer doesn't fit). This could be
changed if it's more annoying this way. But if we had
proper edge-dragging in zones, probably would be better
than setting a chanfer manually.
Also fix the GetNeighbourIndexes which seems to have
always been broken (but is not actually used by anything at
present).
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/16771
Texts items living in a footprints use a relative position, but not dimensions
So we do not move and rotate a dimension living in a fp when loading a kicad_pcb
file: pos/rot is already in board coordinates.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18904
Dimensions are parsed before the text elements embedded in them are. So
we need to handle the existing pointer without copying to avoid dangling
pointers in the font map later. Based on suggested patch from
@charrasjp
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18853
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
Thse were just omitted from the JSON loader, so they were
uninitialised. Valgrind doesn't like them because they get
compared to things before being set.
- Implements component classes for placement rule areas and multichannel tool
- Implements property inspector properties for rule areas
- Fixes some zone member default initialisation issues
- Gates all multichannel-related imlpementation with existing adv config flag
- Removes rule area type enum, replaces with inference from keepout and
placement settings
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
Using wxASSERT to check for a null pointer will crash after dismissing the
assertion dialog in debug builds and crash in release builds. Use wxCHECK
to take the correct action to prevent the crash.
Looks like the primitive parent member (the pad handling the primitive) is
not always correct: it should be the pad.cpp.
It can create crash (for instance in DRC)
Fixes a text failure in qa_pcbnew.
If this is not initialised, at least the comparison operator will be
operating on junk member values if either side has not had the
source type set.
Maybe it doesn't even make sense for the source type/source to be
checked if m_isRuleArea is false (they're presumably "do not care" in
that context), but if they're initialised, it doesn't matter either
way.
The Load and MatchesFile methods never change the aSettings parameter.
They also immediately dereference the pointer unchecked, so make it a
ref so that the client code (single call site) becomes formally
responsible for never passing a nullptr.
The sheet list is returned as a copy of the cached list rather than a
reference to prevent external code from changing the list. While not as
performant, it eliminates the risk of the sheet list being altered in
ways that could break the schematic. The sheet list should only be
updated by calling SCHEMATIC::RefreshHierarchy() when any appropriate
sheet changes are made.
Note to developers: there is something inherently different about how the
QA tests are loading and handling schematics versus the schematic editor.
Using the cached sheet list for the SCHEMATIC object will cause some QA
test to fail. This is why SCHEMATIC::Hierarchy() has not replaced
SCHEMATIC::BuildSheetListSortedByPageNumbers() everywhere.
Moves the logic into the SCH_RENDER_SETTINGS, rather than
repeating it in EESCHEMA/SYMBOL_EDITOR_SETTINGS (they still
maintain their state there, but the painter looks at the
SCH_RENDER_SETTINGS).
Also turn them off for preview purposes.
This tells you the arguments when it fails.
BOOST_TEST is available in all our Boost.Test version.
Even if you didn't use it, these calls should have been
BOOST_TEST_EQUAL(A, B) which also tells you the
arguments on a test failure.
This makes it easier to see which pins have alt modes
available. There is an option to turn them off.
The icon positions are chosen so they they shouldn't
interfere as far as possible:
* If the text is inside, the icon goes more inside
the body
* If the text is above/below the pin, it goes away from
the body
This means it won't collide with a symbol wall in
most cases, but some symbols with alt pins on opposing
sides may need to be widened if the icons are show.
Includes a rather fiddly refactor of the SCH_PIN painter
function, which needs quite a lot of massaging to allow
it to figure out where an icon would go. Quite a bit
of logic is broken out into smaller encapsulations with
less visible state to each chunk.
Icon modes for base-name-selected and alt-selected are
included, but only the former works due to information
being thrown away during the SCH_PAINTER tempPin
process.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11069
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).
This is confusing because the pads don't get a locked item shadow,
so it's hard to see what is inhibiting a footprint move if a pad got
locked.
Rather than implement the shadow, disable pad locking in pcbnew
(no locking exists in FP editor). Pad lock state isn't persisted
to the board file, so it's not a fully supported action, and it's
unlikely to be actively useful.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18862