From 66e3e12a9d7578928984f332aa088d8e3134ad5a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 24 Oct 2020 19:39:19 +0100 Subject: [PATCH] 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. --- common/gal/opengl/opengl_gal.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index f55e4e1764..477f12a943 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -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( aStartAngle, >, aEndAngle ); - // Bigger arcs need smaller alpha increment to make them look smooth - double alphaIncrement = std::min( 1e6 / aRadius, 2.0 * M_PI / CIRCLE_POINTS ); + double alphaIncrement = calcAngleStep( aRadius ); // 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 @@ -855,18 +854,6 @@ void OPENGL_GAL::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadius, d // Recalculate alphaIncrement with a even integer number of segment 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(); currentManager->Translate( aCenterPoint.x, aCenterPoint.y, 0.0 );