Fix the order of evaluation in the arc printing
MapAngles will adjust by small amounts the angles t1 and t2. This adjustment will determine the CW/CCW drawing. Therefore, the MapAngles needs to be called explicitly before the Normalize180() call. Left-to-Right evaluation is not a given for MSVC Fixes https://gitlab.com/kicad/code/kicad/issues/11050
This commit is contained in:
parent
d39127cac7
commit
c9fb95b888
|
@ -265,7 +265,12 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset
|
||||||
|
|
||||||
CalcArcAngles( t1, t2 );
|
CalcArcAngles( t1, t2 );
|
||||||
|
|
||||||
if( aTransform.MapAngles( &t1, &t2 ) == ( ( t1 - t2 ).Normalize180() > ANGLE_0 ) )
|
// N.B. The order of evaluation is critical here as MapAngles will modify t1, t2
|
||||||
|
// and the Normalize routine depends on these modifications for the correct output
|
||||||
|
bool transformed = aTransform.MapAngles( &t1, &t2 );
|
||||||
|
bool transformed2 = ( ( t1 - t2 ).Normalize180() > ANGLE_0 );
|
||||||
|
|
||||||
|
if( transformed == transformed2 )
|
||||||
std::swap( pt1, pt2 );
|
std::swap( pt1, pt2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue