From 56374ffa26399bd40b5243e55e5dfa750cbccb2a Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 6 Sep 2021 18:34:41 +0200 Subject: [PATCH] Try to fix a compil issue that does not happen on my computers. --- common/gal/opengl/opengl_gal.cpp | 2 +- include/gal/opengl/opengl_gal.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 2623a7df4d..13926fbff5 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -869,7 +869,7 @@ void OPENGL_GAL::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadius, // Calculate the seg count to approximate the arc with aMaxError or less int segCount360 = GetArcToSegmentCount( aRadius, aMaxError, 360.0 ); - segCount360 = std::max( CIRCLE_POINTS, segCount360 ); + segCount360 = std::max( SEG_PER_CIRCLE_COUNT, segCount360 ); double alphaIncrement = 2.0 * M_PI / segCount360; // Refinement: Use a segment count multiple of 2, because we have a control point diff --git a/include/gal/opengl/opengl_gal.h b/include/gal/opengl/opengl_gal.h index ba82458a8f..4e79268d68 100644 --- a/include/gal/opengl/opengl_gal.h +++ b/include/gal/opengl/opengl_gal.h @@ -49,6 +49,9 @@ #define CALLBACK #endif +///< The default number of points for circle approximation +#define SEG_PER_CIRCLE_COUNT 64 + struct bitmap_glyph; namespace KIGFX @@ -56,6 +59,7 @@ namespace KIGFX class SHADER; class GL_BITMAP_CACHE; + /** * OpenGL implementation of the Graphics Abstraction Layer. * @@ -299,9 +303,6 @@ private: /// Super class definition typedef GAL super; - static const int CIRCLE_POINTS = 64; ///< The number of points for circle approximation - static const int CURVE_POINTS = 32; ///< The number of points for curve approximation - static wxGLContext* m_glMainContext; ///< Parent OpenGL context wxGLContext* m_glPrivContext; ///< Canvas-specific OpenGL context static int m_instanceCounter; ///< GL GAL instance counter @@ -510,7 +511,7 @@ private: double calcAngleStep( double aRadius ) const { // Bigger arcs need smaller alpha increment to make them look smooth - return std::min( 1e6 / aRadius, 2.0 * M_PI / CIRCLE_POINTS ); + return std::min( 1e6 / aRadius, 2.0 * M_PI / SEG_PER_CIRCLE_COUNT ); } double getWorldPixelSize() const;