summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2021-10-11 11:11:26 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-11 13:09:50 +0000
commit65de4d17d82a490c8b245475ecf2e3df2b95703c (patch)
tree6d7e75494b28987e25056137b85f183a975d88ee
parent41286761152817b80cb2a7cb36a3e2e9c189f996 (diff)
downloadqtsvg-65de4d17d82a490c8b245475ecf2e3df2b95703c.tar.gz
Fix text x/y when the length is not in pixels
Fixes: QTBUG-97421 Change-Id: I41f3cbf8e747530a67fe5074a988ba49aeb43b8e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit fc1e1878743bcaac0c81a4748a00d0042cc15815) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/svg/qsvghandler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index f2757bd..8a16568 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -3351,7 +3351,9 @@ static QSvgNode *createTextNode(QSvgNode *parent,
//### editable and rotate not handled
QSvgHandler::LengthType type;
qreal nx = parseLength(x.toString(), type, handler);
+ nx = convertToPixels(nx, true, type);
qreal ny = parseLength(y.toString(), type, handler);
+ ny = convertToPixels(ny, true, type);
QSvgNode *text = new QSvgText(parent, QPointF(nx, ny));
return text;