gal: opengl: use correct radius for graphical circles

This commit is contained in:
Tomasz Włostowski 2019-02-19 01:55:32 +01:00
parent 3a0dbffa9e
commit 3b3c674c1a
2 changed files with 6 additions and 4 deletions

View File

@ -148,12 +148,15 @@ void computeLineCoords( bool posture, vec2 vs, vec2 vp, vec2 texcoord, vec2 dir,
}
void computeCircleCoords( float vertexIndex, float radius, float lineWidth )
void computeCircleCoords( float mode, float vertexIndex, float radius, float lineWidth )
{
vec4 delta;
vec4 center = roundv( gl_ModelViewProjectionMatrix * gl_Vertex + vec4(1, 1, 0, 0), screenPixelSize );
float pixelWidth = roundr( lineWidth / worldPixelSize, 1.0);
float pixelR = roundr( radius / worldPixelSize, 1.0);
float pixelR = roundr( radius / worldPixelSize, 1.0);
if( mode == SHADER_STROKED_CIRCLE)
pixelR += pixelWidth / 2.0;
vec4 adjust = vec4(-1, -1, 0, 0);
@ -227,7 +230,7 @@ void main()
else if( mode == SHADER_LINE_F )
computeLineCoords( posture, -vs, vp, vec2( 1, 1 ), vec2( -1, 0 ), lineWidth, false );
else if( mode == SHADER_FILLED_CIRCLE || mode == SHADER_STROKED_CIRCLE)
computeCircleCoords( shaderParams.y, shaderParams.z, shaderParams.w );
computeCircleCoords( mode, shaderParams.y, shaderParams.z, shaderParams.w );
else
{
// Pass through the coordinates like in the fixed pipeline

View File

@ -322,7 +322,6 @@ private:
GLint ufm_worldPixelSize;
GLint ufm_screenPixelSize;
GLint ufm_pixelSizeMultiplier;
GLint ufm_backingScaleFactor;
std::unique_ptr<GL_BITMAP_CACHE> bitmapCache;