Get rid of line-weight component of overbar height.

It's not really necessary and it messes up text highlighting.

Fixes https://gitlab.com/kicad/code/kicad/issues/3680
This commit is contained in:
Jeff Young 2020-02-03 19:34:43 +00:00
parent fbeb0709ef
commit a1c2abaff5
1 changed files with 6 additions and 4 deletions

View File

@ -36,7 +36,7 @@
using namespace KIGFX; using namespace KIGFX;
const double STROKE_FONT::INTERLINE_PITCH_RATIO = 1.61; const double STROKE_FONT::INTERLINE_PITCH_RATIO = 1.61;
const double STROKE_FONT::OVERBAR_POSITION_FACTOR = 1.22; const double STROKE_FONT::OVERBAR_POSITION_FACTOR = 1.40;
const double STROKE_FONT::BOLD_FACTOR = 1.3; const double STROKE_FONT::BOLD_FACTOR = 1.3;
const double STROKE_FONT::STROKE_FONT_SCALE = 1.0 / 21.0; const double STROKE_FONT::STROKE_FONT_SCALE = 1.0 / 21.0;
const double STROKE_FONT::ITALIC_TILT = 1.0 / 8; const double STROKE_FONT::ITALIC_TILT = 1.0 / 8;
@ -489,9 +489,11 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText, int markupFlags )
double STROKE_FONT::ComputeOverbarVerticalPosition( double aGlyphHeight, double aGlyphThickness ) const double STROKE_FONT::ComputeOverbarVerticalPosition( double aGlyphHeight, double aGlyphThickness ) const
{ {
// Static method. // Static method.
// Compute the Y position of the overbar. This is the distance between // Compute the Y position of the overbar. This is the distance between the text base line
// the text base line and the overbar axis. // and the overbar axis.
return aGlyphHeight * OVERBAR_POSITION_FACTOR + aGlyphThickness; // Don't use the glyph thickness anymore. We don't know how much of it is "real" and how
// much it has been plumped for drop shadows, etc.
return aGlyphHeight * OVERBAR_POSITION_FACTOR;
} }