From a1c2abaff5c2041d66819ba6e646db11b7b17da2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 3 Feb 2020 19:34:43 +0000 Subject: [PATCH] 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 --- common/gal/stroke_font.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/gal/stroke_font.cpp b/common/gal/stroke_font.cpp index 2b397f3aac..d9acc2a4a7 100644 --- a/common/gal/stroke_font.cpp +++ b/common/gal/stroke_font.cpp @@ -36,7 +36,7 @@ using namespace KIGFX; 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::STROKE_FONT_SCALE = 1.0 / 21.0; 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 { // Static method. - // Compute the Y position of the overbar. This is the distance between - // the text base line and the overbar axis. - return aGlyphHeight * OVERBAR_POSITION_FACTOR + aGlyphThickness; + // Compute the Y position of the overbar. This is the distance between the text base line + // and the overbar axis. + // 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; }