diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2010-03-08 15:15:44 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:05:04 (GMT) |
commit | a6ea47b0ced2b07cc1b2ec3562e23fa3153dffb4 (patch) | |
tree | 2c71d165639f73af741918b8f25f7a74775ebfe0 /src/svg/qsvgtinydocument.cpp | |
parent | 902071c2233145453f15bbbded446ad294c9c4a1 (diff) | |
download | Qt-a6ea47b0ced2b07cc1b2ec3562e23fa3153dffb4.zip Qt-a6ea47b0ced2b07cc1b2ec3562e23fa3153dffb4.tar.gz Qt-a6ea47b0ced2b07cc1b2ec3562e23fa3153dffb4.tar.bz2 |
Fixed bounds calculation in QtSvg.
This commit fixes an auto-test failure after fixing QTBUG-8733.
The calculated element bounds should now be much tighter and
respect the width of non-cosmetic pens.
Task-number: QTBUG-8733
Reviewed-by: Trond
(cherry picked from commit ea9f2aeba6f18d19d6a82b3a829373ec032af14f)
Diffstat (limited to 'src/svg/qsvgtinydocument.cpp')
-rw-r--r-- | src/svg/qsvgtinydocument.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp index 0455a13..5848703 100644 --- a/src/svg/qsvgtinydocument.cpp +++ b/src/svg/qsvgtinydocument.cpp @@ -277,7 +277,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id, p->save(); - const QRectF elementBounds = node->transformedBounds(QTransform()); + const QRectF elementBounds = node->transformedBounds(); mapSourceToTarget(p, bounds, elementBounds); QTransform originalTransform = p->worldTransform(); @@ -299,7 +299,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id, for (int i = parentApplyStack.size() - 1; i >= 0; --i) parentApplyStack[i]->applyStyle(p, m_states); - + // Reset the world transform so that our parents don't affect // the position QTransform currentTransform = p->worldTransform(); @@ -432,8 +432,7 @@ QRectF QSvgTinyDocument::boundsOnElement(const QString &id) const const QSvgNode *node = scopeNode(id); if (!node) node = this; - - return node->transformedBounds(QTransform()); + return node->transformedBounds(); } bool QSvgTinyDocument::elementExists(const QString &id) const |