From cb8445f0323b0eefbb04f1d8adad81a00b53abd8 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 3 Feb 2012 14:28:16 +0100 Subject: Remove historical +1 from font height calculation Historically, we've calculated font height as ascent+descent+1. In Qt 4, a patch was added to work around this by subtracting 1 from the descent of the font engines. We now remove the +1 and the work arounds. Change-Id: I7e25d49b97ac892015d3328f32d70eb9a7c2d88f Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/gui/text/qtextengine_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/text/qtextengine_p.h') diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 53031cfcee..b29f626b68 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -366,7 +366,7 @@ struct Q_AUTOTEST_EXPORT QScriptItem QFixed leading; QFixed width; int glyph_data_offset; - QFixed height() const { return ascent + descent + 1; } + QFixed height() const { return ascent + descent; } }; @@ -396,7 +396,7 @@ struct Q_AUTOTEST_EXPORT QScriptLine mutable uint gridfitted : 1; uint hasTrailingSpaces : 1; uint leadingIncluded : 1; - QFixed height() const { return (ascent + descent).ceil() + 1 + QFixed height() const { return (ascent + descent).ceil() + (leadingIncluded? qMax(QFixed(),leading) : QFixed()); } QFixed base() const { return ascent + (leadingIncluded ? qMax(QFixed(),leading) : QFixed()); } -- cgit v1.2.3