From 0063f2c12dcf9d17dc4d7f35c1988c3556f5288b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 7 Sep 2018 11:20:42 +0100 Subject: [PATCH] Stroke rectangles after filling so fill doesn't cover 1/2 of stroke. --- common/gal/opengl/opengl_gal.cpp | 28 ++++++++++++++-------------- eeschema/sch_painter.cpp | 8 +++----- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index dbaf510b47..8caeae594b 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -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 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 pointList; + pointList.push_back( aStartPoint ); + pointList.push_back( diagonalPointA ); + pointList.push_back( aEndPoint ); + pointList.push_back( diagonalPointB ); + pointList.push_back( aStartPoint ); + DrawPolyline( pointList ); + } } diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 853cc689db..57f384e9fa 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -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 ); }