Fix issue with overbars in bitmap text.
This commit is contained in:
parent
5bb6b1a3cc
commit
9328c78b08
|
@ -1247,14 +1247,11 @@ void OPENGL_GAL::BitmapText( const wxString& aText, const VECTOR2D& aPosition,
|
|||
return GAL::BitmapText( aText, aPosition, aRotationAngle );
|
||||
|
||||
const UTF8 text( aText );
|
||||
// Compute text size, so it can be properly justified
|
||||
VECTOR2D textSize;
|
||||
float commonOffset;
|
||||
std::tie( textSize, commonOffset ) = computeBitmapTextSize( text );
|
||||
|
||||
const double SCALE = 1.4 * GetGlyphSize().y / textSize.y;
|
||||
bool overbar = false;
|
||||
|
||||
int overbarLength = 0;
|
||||
double overbarHeight = textSize.y;
|
||||
|
||||
|
@ -1347,7 +1344,7 @@ void OPENGL_GAL::BitmapText( const wxString& aText, const VECTOR2D& aPosition,
|
|||
overbarLength = 0;
|
||||
}
|
||||
|
||||
if( overbar )
|
||||
if( overbarDepth >= 0 )
|
||||
overbarLength += drawBitmapChar( *chIt );
|
||||
else
|
||||
drawBitmapChar( *chIt );
|
||||
|
@ -1356,7 +1353,7 @@ void OPENGL_GAL::BitmapText( const wxString& aText, const VECTOR2D& aPosition,
|
|||
// Handle the case when overbar is active till the end of the drawn text
|
||||
m_currentManager->Translate( 0, commonOffset, 0 );
|
||||
|
||||
if( overbar && overbarLength > 0 )
|
||||
if( overbarDepth >= 0 && overbarLength > 0 )
|
||||
drawBitmapOverbar( overbarLength, overbarHeight );
|
||||
|
||||
Restore();
|
||||
|
|
Loading…
Reference in New Issue