diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-11-13 12:44:40 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-11-13 13:01:35 (GMT) |
commit | 946eab3e327bddcce10ed838462c0ca56ff011f0 (patch) | |
tree | 9910b436b5852d2f553c0e7228970ed251ef24c7 /src/declarative/graphicsitems/qmlgraphicstext.cpp | |
parent | 1e28371e8cd568292bb75667e7a2b19fd7953748 (diff) | |
download | Qt-946eab3e327bddcce10ed838462c0ca56ff011f0.zip Qt-946eab3e327bddcce10ed838462c0ca56ff011f0.tar.gz Qt-946eab3e327bddcce10ed838462c0ca56ff011f0.tar.bz2 |
Avoid clipping last pixel of text in QML in some cases
We would floor the width of the text layout and clip the output to this,
hence cutting away the last pixel of the text in cases where the text
width was not pixel aligned.
Task-number: QTBUG-5431
Reviewed-by: Gunnar
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicstext.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicstext.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicstext.cpp b/src/declarative/graphicsitems/qmlgraphicstext.cpp index 504eb2a..d0aec8d 100644 --- a/src/declarative/graphicsitems/qmlgraphicstext.cpp +++ b/src/declarative/graphicsitems/qmlgraphicstext.cpp @@ -50,6 +50,7 @@ #include <QTextCursor> #include <QGraphicsSceneMouseEvent> #include <QPainter> +#include <qmath.h> QT_BEGIN_NAMESPACE QML_DEFINE_TYPE(Qt,4,6,Text,QmlGraphicsText) @@ -600,7 +601,7 @@ QSize QmlGraphicsTextPrivate::setupTextLayout(QTextLayout *layout) line.setPosition(QPointF(0, height)); height += int(line.height()); } - return QSize((int)widthUsed, height); + return QSize(qCeil(widthUsed), height); } QPixmap QmlGraphicsTextPrivate::wrappedTextImage(bool drawStyle) |