Stroke rectangles after filling so fill doesn't cover 1/2 of stroke.

This commit is contained in:
Jeff Young 2018-09-07 11:20:42 +01:00
parent 48688b5074
commit 0063f2c12d
2 changed files with 17 additions and 19 deletions

View File

@ -809,20 +809,6 @@ void OPENGL_GAL::DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEn
VECTOR2D diagonalPointA( aEndPoint.x, aStartPoint.y );
VECTOR2D diagonalPointB( aStartPoint.x, aEndPoint.y );
// Stroke the outline
if( isStrokeEnabled )
{
currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a );
std::deque<VECTOR2D> pointList;
pointList.push_back( aStartPoint );
pointList.push_back( diagonalPointA );
pointList.push_back( aEndPoint );
pointList.push_back( diagonalPointB );
pointList.push_back( aStartPoint );
DrawPolyline( pointList );
}
// Fill the rectangle
if( isFillEnabled )
{
@ -838,6 +824,20 @@ void OPENGL_GAL::DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEn
currentManager->Vertex( aEndPoint.x, aEndPoint.y, layerDepth );
currentManager->Vertex( diagonalPointB.x, diagonalPointB.y, layerDepth );
}
// Stroke the outline
if( isStrokeEnabled )
{
currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a );
std::deque<VECTOR2D> pointList;
pointList.push_back( aStartPoint );
pointList.push_back( diagonalPointA );
pointList.push_back( aEndPoint );
pointList.push_back( diagonalPointB );
pointList.push_back( aStartPoint );
DrawPolyline( pointList );
}
}

View File

@ -308,18 +308,16 @@ void SCH_PAINTER::draw( LIB_RECTANGLE *aRect, int aLayer )
if( !isUnitAndConversionShown( aRect ) )
return;
defaultColors(aRect);
defaultColors( aRect );
//m_gal->SetIsStroke( true );
m_gal->SetLineWidth( aRect->GetPenSize() );
m_gal->DrawRectangle( mapCoords( aRect->GetPosition() ), mapCoords( aRect->GetEnd() ) );
}
void SCH_PAINTER::triLine ( const VECTOR2D &a, const VECTOR2D &b, const VECTOR2D &c )
{
m_gal->DrawLine ( a, b );
m_gal->DrawLine ( b, c );
m_gal->DrawLine ( a, b );
m_gal->DrawLine ( b, c );
}