diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 6963bcfead..6b1f794f42 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -1986,7 +1986,7 @@ void OPENGL_GAL::drawBitmapOverbar( double aLength, double aHeight ) Translate( VECTOR2D( -aLength, -aHeight-1.5*H ) ); currentManager->Reserve( 6 ); - currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, 1 ); + currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a ); currentManager->Shader( 0 ); diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 4c81c84987..a7ecdb03ae 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -503,28 +503,38 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) return; const wxString& netName = UnescapeString( aTrack->GetShortNetname() ); + double textSize = width; + double penWidth = width / 12.0; VECTOR2D textPosition = start + line / 2.0; // center of the track - - double textOrientation; + double textOrientation; if( end.y == start.y ) // horizontal + { textOrientation = 0; + textPosition.y += penWidth; + } else if( end.x == start.x ) // vertical + { textOrientation = M_PI / 2; + textPosition.x += penWidth; + } else + { textOrientation = -atan( line.y / line.x ); + textPosition.x += penWidth / 1.4; + textPosition.y += penWidth / 1.4; + } - double textSize = width; m_gal->SetIsStroke( true ); m_gal->SetIsFill( false ); m_gal->SetStrokeColor( color ); - m_gal->SetLineWidth( width / 10.0 ); + m_gal->SetLineWidth( penWidth ); m_gal->SetFontBold( false ); m_gal->SetFontItalic( false ); m_gal->SetFontUnderlined( false ); m_gal->SetTextMirrored( false ); - m_gal->SetGlyphSize( VECTOR2D( textSize * 0.7, textSize * 0.7 ) ); + m_gal->SetGlyphSize( VECTOR2D( textSize * 0.55, textSize * 0.55 ) ); m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER ); m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER ); m_gal->BitmapText( netName, textPosition, textOrientation );