diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index d9aaee9451..31f40886b5 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -2040,7 +2040,7 @@ void OPENGL_GAL::drawBitmapOverbar( double aLength, double aHeight ) Save(); - Translate( VECTOR2D( -aLength, -aHeight - 1.5 * H ) ); + Translate( VECTOR2D( -aLength, -aHeight ) ); m_currentManager->Reserve( 6 ); m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b, m_strokeColor.a ); @@ -2109,15 +2109,7 @@ std::pair OPENGL_GAL::computeBitmapTextSize( const UTF8& aText } if( glyph ) - { textSize.x += glyph->advance; - - if( overbarDepth != -1 ) - { - const float H = lineGlyph->maxy - lineGlyph->miny; - textSize.y = std::max( textSize.y, charHeight + 1.5 * H ); - } - } } textSize.y = std::max( textSize.y, charHeight ); diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 15e9f690fd..41b63dfc7b 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -994,15 +994,17 @@ void SCH_GLOBALLABEL::RunOnChildren( const std::function& aFu wxPoint SCH_GLOBALLABEL::GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const { - wxPoint text_offset; - int dist = GetTextOffset( aSettings ); + int horiz = GetTextOffset( aSettings ); + + // Center the text on the center line of "E" instead of "R" to make room for an overbar + int vert = GetTextHeight() * 0.0715; switch( m_shape ) { case PINSHEETLABEL_SHAPE::PS_INPUT: case PINSHEETLABEL_SHAPE::PS_BIDI: case PINSHEETLABEL_SHAPE::PS_TRISTATE: - dist += GetTextHeight() * 3 / 4; // Use three-quarters-height as proxy for triangle size + horiz += GetTextHeight() * 3 / 4; // Use three-quarters-height as proxy for triangle size break; case PINSHEETLABEL_SHAPE::PS_OUTPUT: @@ -1014,13 +1016,11 @@ wxPoint SCH_GLOBALLABEL::GetSchematicTextOffset( const RENDER_SETTINGS* aSetting switch( GetLabelSpinStyle() ) { default: - case LABEL_SPIN_STYLE::LEFT: text_offset.x -= dist; break; - case LABEL_SPIN_STYLE::UP: text_offset.y -= dist; break; - case LABEL_SPIN_STYLE::RIGHT: text_offset.x += dist; break; - case LABEL_SPIN_STYLE::BOTTOM: text_offset.y += dist; break; + case LABEL_SPIN_STYLE::LEFT: return wxPoint( -horiz, vert ); + case LABEL_SPIN_STYLE::UP: return wxPoint( vert, -horiz ); + case LABEL_SPIN_STYLE::RIGHT: return wxPoint( horiz, vert ); + case LABEL_SPIN_STYLE::BOTTOM: return wxPoint( vert, horiz ); } - - return text_offset; }