Allow for rounding error in connection width checker
We perform checks using squared distance but this loses the integer
rounding in the standard norm. To correct for this, we allow a single
IU in the restriction, allowing fractionally smaller connection widths
before calculating the squared limit
Fixes https://gitlab.com/kicad/code/kicad/issues/14130
Fixes https://gitlab.com/kicad/code/kicad/issues/14131
(cherry picked from commit a0f99ea8ba
)
This commit is contained in:
parent
90eb5e9c31
commit
51b9d8e7ad
|
@ -523,7 +523,12 @@ private:
|
|||
// z-order range for the current point ± limit bounding box
|
||||
const int32_t maxZ = zOrder( aPt->x + m_limit, aPt->y + m_limit );
|
||||
const int32_t minZ = zOrder( aPt->x - m_limit, aPt->y - m_limit );
|
||||
const SEG::ecoord limit2 = SEG::Square( m_limit );
|
||||
|
||||
// Subtract 1 to account for rounding inaccuracies in SquaredEuclideanNorm()
|
||||
// below. We would usually test for rounding in the final value but since we
|
||||
// are working in squared integers here, we allow the 1nm slop rather than
|
||||
// force a separate calculation
|
||||
const SEG::ecoord limit2 = SEG::Square( m_limit - 1 );
|
||||
|
||||
// first look for points in increasing z-order
|
||||
Vertex* p = aPt->nextZ;
|
||||
|
|
Loading…
Reference in New Issue