summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2021-10-11 11:13:57 +0200
committerAlbert Astals Cid <albert.astals.cid@kdab.com>2021-10-11 15:09:45 +0200
commit4531aad935d55924a32212b339c657ce363a6c08 (patch)
treedec93c4da4daa0fbb4502d63675c63cd9411c69d /src
parentfc1e1878743bcaac0c81a4748a00d0042cc15815 (diff)
downloadqtsvg-4531aad935d55924a32212b339c657ce363a6c08.tar.gz
Support font size not in pixels
Fixes: QTBUG-97422 Pick-to: 6.2 Change-Id: I4df2af0e657f241af69480e6e30d454870df51d8 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/svg/qsvghandler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 714df49..fc8a71d 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -1361,9 +1361,10 @@ static void parseFont(QSvgNode *node,
case FontSizeNone:
break;
case FontSizeValue: {
- QSvgHandler::LengthType dummy; // should always be pixel size
- fontStyle->setSize(qMin(parseLength(attributes.fontSize, dummy, handler),
- qreal(0xffff)));
+ QSvgHandler::LengthType type;
+ qreal fs = parseLength(attributes.fontSize, type, handler);
+ fs = convertToPixels(fs, true, type);
+ fontStyle->setSize(qMin(fs, qreal(0xffff)));
}
break;
default: