Added Distance(VECTOR2) function that returns a double. Removed
superfluous EuclideanNorm, GetLineLength, integer constructor for
EDA_ANGLE (this promotes to double in the CTOR), DistanceLinePoint and
HitTestPoints
Also extended the size for arc calculations that get distances to center
points to avoid overflow
- Changes BOX2 size to extended coordinates.
- Adds BOX2ISafe to construct a BOX2I that will fit in int32.
- Adds more checks.
- Safer computations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17670
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
these very small arcs do not allow to calculate a reliable center position,
and therefore a reliable radius.
So seeing them as a very small segment fix plotting/drawing issues.
Fixes#15639https://gitlab.com/kicad/code/kicad/-/issues/15639
When working in high contrast mode, we want to be able to select a
footprint with only elements in, e.g. silk and fab layers.
The previous design for footprint IsOnLayer had one behavior of every
other element and a different behavior for footprints. This leads to
multiple bugs as new features use the overloaded IsOnLayer expecting it
to report if the element exists on a layer or not.
For footprints, we need a different routine to determine whether or not
to select the footprint when clicking on it. IsOnLayer will report if
the footprint has any elements on a specific layer but we don't want to
use the bbox for a hittest because large footprints with through hole
pads will exist on every layer and have an enormous bbox. Instead, we
filter footprints based on the hittest of each element. This behaves in
a more logical fashion, allowing you to select a footprint by clicking
on a visible element of that footprint.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15284
This makes it clearer that the overrides are not inverses of each
other -- one overrides the flashing state and the other overrides
the connection state (to other zones, not to everything).
Also fixes a bug where we were failing to check the force-no-connect
for pads.
The implementation used to always check F_Cu and B_Cu, rather than
where the via started and ended (which will be different for blind/
buried vias and microvias).
Also adds some debugging to try to catch dangling pointers.
Also adds a cache for group bounding boxes (which will be expensive
to calculate for large groups).
Fixes https://gitlab.com/kicad/code/kicad/issues/12875
Rather than moving the netname around, we want to keep the correct
number of netnames on a track such that there is always at least one
displayed on long tracks even when panning.
This reduces calculation time while keeping the netnames visible
Fixes https://gitlab.com/kicad/code/kicad/issues/12436
When panning, we should only redraw the netnames when they come into
view or go out of view. Caching the LOD provides this preventing
unneeded redraws while still redrawing on zoom changes
Fixes https://gitlab.com/kicad/code/kicad/issues/12436
1) The highest priority zone that a via/pad collides with "owns" its
connectivity state. Once set, lower priority zones cannot change it --
and in fact, if they would have connected to it are forced not to.
2) The connectivity state goes with the zone fill state, and therefore
must be saved in the file.
3) Display of remove-unconnected's pads is no longer done in GetViewLOD()
(which isn't called for selected items), and is instead done in PCB_PAINTER.
This allows us to draw the full pad in outline mode when a via/pad is
selected which would otherwise only show the hole.
4) Note that in some cases this will still generate DRC errors -- in
particular when a via nearly collides with a higher priority zone it
won't get "owned" by that zone and may therefore have insufficient
clearance if said zone concludes it's unconnected and a subsequent
(lower priority) zone connects to it (causing it to now become flashed).
Fixes https://gitlab.com/kicad/code/kicad/issues/11299