Allow screen rendering to be maxError out from WYSIWYG.

Correcting the error is more trouble than it is worth, and anyway
might not be corrected exactly the same way plotting/filling/DRC
is corrected anyway.
This commit is contained in:
Jeff Young 2020-10-24 19:39:19 +01:00
parent 050cfd34dd
commit 66e3e12a9d
1 changed files with 1 additions and 14 deletions

View File

@ -841,8 +841,7 @@ void OPENGL_GAL::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadius, d
// Swap the angles, if start angle is greater than end angle // Swap the angles, if start angle is greater than end angle
SWAP( aStartAngle, >, aEndAngle ); SWAP( aStartAngle, >, aEndAngle );
// Bigger arcs need smaller alpha increment to make them look smooth double alphaIncrement = calcAngleStep( aRadius );
double alphaIncrement = std::min( 1e6 / aRadius, 2.0 * M_PI / CIRCLE_POINTS );
// Refinement: Use a segment count multiple of 2, because we have a control point // Refinement: Use a segment count multiple of 2, because we have a control point
// on the middle of the arc, and the look is better if it is on a segment junction // on the middle of the arc, and the look is better if it is on a segment junction
@ -855,18 +854,6 @@ void OPENGL_GAL::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadius, d
// Recalculate alphaIncrement with a even integer number of segment // Recalculate alphaIncrement with a even integer number of segment
alphaIncrement = (aEndAngle -aStartAngle ) / seg_count; alphaIncrement = (aEndAngle -aStartAngle ) / seg_count;
// Code disabled because it creates serious issues:
// - The arc is inside the polygonization error, but the interior of arc is also important
// and putting error inside the arc creates significant errors inside this arc
// - for thin arcs the control points are not even inside the arc, and HitTest is
// not even working
// I am also pretty sure the formula is incorrect. (JPC)
#if 0
// Draw entirely within the real arc boundary (ie: put all polygonization error inside)
double correctionFactor = cos( M_PI / (double) CIRCLE_POINTS );
aRadius *= correctionFactor;
#endif
Save(); Save();
currentManager->Translate( aCenterPoint.x, aCenterPoint.y, 0.0 ); currentManager->Translate( aCenterPoint.x, aCenterPoint.y, 0.0 );