summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextengine_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2012-02-03 14:28:16 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-17 05:26:44 +0100
commitcb8445f0323b0eefbb04f1d8adad81a00b53abd8 (patch)
tree502411d2ce366cb25a1ac9424eb314c320ece905 /src/gui/text/qtextengine_p.h
parent2801db558c56e98753e297c1aeabd4fd2975e09a (diff)
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 <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/gui/text/qtextengine_p.h')
-rw-r--r--src/gui/text/qtextengine_p.h4
1 files changed, 2 insertions, 2 deletions
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()); }