OpenGL: Make circle/arc drawing match Cairo for some edge cases
This commit is contained in:
parent
eeeed88425
commit
921e68107b
|
@ -191,8 +191,8 @@ void filledCircle( vec2 aCoord )
|
|||
|
||||
void strokedCircle( vec2 aCoord, float aRadius, float aWidth )
|
||||
{
|
||||
float outerRadius = aRadius + ( aWidth / 2 );
|
||||
float innerRadius = aRadius - ( aWidth / 2 );
|
||||
float outerRadius = max( aRadius + ( aWidth / 2 ), 0.0 );
|
||||
float innerRadius = max( aRadius - ( aWidth / 2 ), 0.0 );
|
||||
float relWidth = innerRadius / outerRadius;
|
||||
|
||||
if( ( dot( aCoord, aCoord ) < 1.0 ) &&
|
||||
|
|
|
@ -591,7 +591,13 @@ void OPENGL_GAL::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadius, d
|
|||
double aEndAngle, double aWidth )
|
||||
{
|
||||
if( aRadius <= 0 )
|
||||
{
|
||||
// Arcs of zero radius are a circle of aWidth diameter
|
||||
if( aWidth > 0 )
|
||||
DrawCircle( aCenterPoint, aWidth / 2.0 );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Swap the angles, if start angle is greater than end angle
|
||||
SWAP( aStartAngle, >, aEndAngle );
|
||||
|
|
Loading…
Reference in New Issue