Fix qa failure
This commit is contained in:
parent
ee3533baeb
commit
819bdf4372
|
@ -444,7 +444,9 @@ bool SHAPE_ARC::Collide( const VECTOR2I& aP, int aClearance, int* aActual,
|
|||
|
||||
if( !dist )
|
||||
{
|
||||
dist = radius - ( aP - center ).EuclideanNorm();
|
||||
// Be sure to keep the sqrt of the squared distance instead of allowing a EuclideanNorm
|
||||
// because this trucates the distance to an integer before subtracting
|
||||
dist = KiROUND( radius - sqrt( ( aP - center ).SquaredEuclideanNorm() ) );
|
||||
nearestPt = center + VECTOR2I( radius, 0 );
|
||||
RotatePoint( nearestPt, center, angleToPt );
|
||||
}
|
||||
|
|
|
@ -597,12 +597,18 @@ static const std::vector<ARC_PT_COLLIDE_CASE> arc_pt_collide_cases = {
|
|||
{ " -90deg, 0 cl, 90 deg ", { { 0, 0 }, { 71, 71 }, -90.0 }, 0, { 71, 71 }, true, 0 },
|
||||
{ " -90deg, 0 cl, 135 deg ", { { 0, 0 }, { 71, 71 }, -90.0 }, 0, { 0, -100 }, false, -1 },
|
||||
{ " -90deg, 0 cl, -45 deg ", { { 0, 0 }, { 71, 71 }, -90.0 }, 0, { 0, 100 }, false, -1 },
|
||||
{ "issue 11358",
|
||||
{ "issue 11358 collide",
|
||||
{ { 119888000, 60452000 }, { 120904000, 60452000 }, 360.0 },
|
||||
0,
|
||||
{ 120395500, 59571830 },
|
||||
true,
|
||||
0 },
|
||||
{ "issue 11358 dist",
|
||||
{ { 119888000, 60452000 }, { 120904000, 60452000 }, 360.0 },
|
||||
100,
|
||||
{ 118872050, 60452000 },
|
||||
true,
|
||||
50 },
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue