summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHatem ElKharashy <[email protected]>2025-04-25 14:03:00 +0300
committerHatem ElKharashy <[email protected]>2025-05-21 12:15:22 +0300
commitcc9cec53830d64940bea2787be3da616117b64cf (patch)
tree044386dec5a48537e8d771d42995d17e59eba705 /src
parent1a6e6d933d756758e0cb4ab66129bf274674e4e0 (diff)
Fix radial gradient unit parsingHEADdev
The QSvgHandler ignored the units for radial gradient, and tried to convert the parsed number directly to a double. Instead, convertToNumber function can be used to properly check for units. Fixes: QTBUG-126482 Pick-to: 6.9 6.8 6.5 Change-Id: I4632dcf041bcd0b1496853a0b009c97dd01092a6 Reviewed-by: Matthias Rauter <[email protected]> Reviewed-by: Robert Löhning <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/svg/qsvghandler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 59c5932..de2080e 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -3285,22 +3285,22 @@ static QSvgStyleProperty *createRadialGradientNode(QSvgNode *node,
qreal ncx = 0.5;
qreal ncy = 0.5;
if (!cx.isEmpty())
- ncx = QSvgUtils::toDouble(cx);
+ ncx = convertToNumber(cx);
if (!cy.isEmpty())
- ncy = QSvgUtils::toDouble(cy);
+ ncy = convertToNumber(cy);
qreal nr = 0.5;
if (!r.isEmpty())
- nr = QSvgUtils::toDouble(r);
+ nr = convertToNumber(r);
if (nr <= 0.0)
return nullptr;
qreal nfx = ncx;
if (!fx.isEmpty())
- nfx = QSvgUtils::toDouble(fx);
+ nfx = convertToNumber(fx);
qreal nfy = ncy;
if (!fy.isEmpty())
- nfy = QSvgUtils::toDouble(fy);
+ nfy = convertToNumber(fy);
QRadialGradient *grad = new QRadialGradient(ncx, ncy, nr, nfx, nfy, 0);
grad->setInterpolationMode(QGradient::ComponentInterpolation);