The logic for this was duplicated, in two very different forms,
between the SCH_PIN bounding box function and the
SCH_PAINTER draw function.
And the SCH_PIN one was slightly wrong, as it didn't take into
account the PIN_TEXT_MARGIN, or the electrical types.
Provide a way for clients of the PIN_LAYOUT_CACHE to access
the name and number boxes.
The bounding box calculations of SCH_PINs are pretty complicated.
There is already caching of the name and number texts, but the
SCH_PAINTER (for example) has to repeat this work and sometimes
slightly diverges. For example, dangling indicators and alt
icons are painted, but not included in the bbox.
This commit introduces a more encapsulated 'layout cache' object which will
take care of caching the current extents, but also providing layout
geometry to SCH_PAINTER (and other interested code, like hit testers
on a given field) witohut requiring recomputation or reimplementation.
The extents calculations use exclusively the public API, so it's nice
and easy to split it out.
In this commit, nothing is functionally changed - the name and number
are still cached, and everything else is computed in the exact same way.
This is the groundwork for fixing this issue:
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18894
This class had m_ShowPinsElectricalType and m_ShowPinElectricalTypes.
Nearly everything used the former, only one callsite used the latter,
which would never have been changed.
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
Apparently GCC does not like competing definitions of the == operator.
The recent refactoring away of all LIB_ITEM objects created a conflict
with the SCH_ITEM == operator definition. This change required some
rather ugly comparison changes. There were no unit test failures but
that doesn't mean something didn't get broken.
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
C++20 added new reverse and rewritten candidates. This can confuse the compiler because it'll test both A==B and B==A for overloads.
Because we were defining parent class equality overloads, A==B and B==A was considered ambigious due to both being compatible in casting.
So we needed to add explicit child class equality operator overloads
Prior to this change, the schematic connectivity was updated any time a
change was made to a connectable object. Now the connectivity is only
updated when an object change actually affects the connectivity. Other
properties like line width, fill type, custom fonts, etc. will not cause
the connectivity graph to be rebuilt.
The SCH_COMMIT flag SKIP_CONNECTIVITY has been removed. All schematic
objects can test if they are connectable and if there have been changes
to any connection properties that require a connectivity rebuild.
Remove duplicate rebuild connectivity calls from editor control tool.
This was causing the tangling end test to get called four times on every
undo and redo action because the dangling end test is already called in
the connectivity graph calculation code.
Update connectivity when changing label names which fixes an unreported
connectivity bug.
This has now pushed the issue down to a broken RTree issue. Skipping the
asserts in debug builds will still crash but now it's pushed down to the
RTree.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.
There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.
Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).
- Consistent calculation of IsStacked() for pins across ERC checks
- Correct placement of ERC marker for unresolved field variables
- Add sheet-specific paths to two ERC check results