From: Jiang Jiang Date: Thu, 28 Apr 2011 15:02:53 +0000 (+0200) Subject: Make text align in the same baseline X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=c37880a3e8190d5eaceb39493fd638e662a32245;p=konrad%2Fqtdeclarative.git Make text align in the same baseline (cherry picked from commit 3f0e1ac647cc8ab700b85772264bc2a95e5301fa) --- diff --git a/src/declarative/items/qsgtext.cpp b/src/declarative/items/qsgtext.cpp index ab4669e..f796006 100644 --- a/src/declarative/items/qsgtext.cpp +++ b/src/declarative/items/qsgtext.cpp @@ -1116,9 +1116,6 @@ QSGNode *QSGText::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) } else { node->addTextLayout(QPoint(0, bounds.y()), &d->layout, d->color, d->style, d->styleColor); - QMatrix4x4 m; - m.translate(0, QFontMetricsF(d->font).ascent()); - node->setMatrix(m); } return node; diff --git a/src/declarative/items/qsgtextnode.cpp b/src/declarative/items/qsgtextnode.cpp index 3bbe0d2..a887c23 100644 --- a/src/declarative/items/qsgtextnode.cpp +++ b/src/declarative/items/qsgtextnode.cpp @@ -188,8 +188,11 @@ void QSGTextNode::addTextLayout(const QPointF &position, QTextLayout *textLayout QSGText::TextStyle style, const QColor &styleColor) { QList glyphsList(textLayout->glyphs()); - for (int i=0; ifont(); QRawFont rawFont = QRawFont::fromFont(font); @@ -353,16 +356,13 @@ void QSGTextNode::addTextBlock(const QPointF &position, QTextDocument *textDocum ? overrideColor : charFormat.foreground().color(); - QFontMetricsF fm(fragment.charFormat().font()); - QPointF ascent(0, fm.ascent()); - QList glyphsList = fragment.glyphs(); for (int i=0; ibaseLine(); qreal width = glyphNode->boundingRect().width(); addTextDecorations(baseLine, font, color, width,