summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2015-07-22 08:39:29 +0200
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2015-07-22 15:51:10 +0000
commit7089c98383e5e22ca1fbae9a4fff34b312810749 (patch)
tree3b2d4d93f724cd13d5be374f939c3e156b67a696 /src
parenta0e2e715f58134c7c913996e036b154df1f71d99 (diff)
QPdfEnginePrivate - fix for '-qreal float' build.
Literals 1. or 0. have type double, but QGradientStop.first is qreal and thus can be float depending on platform/configuration, making qBound call invalid (qBound(0., qreal_value, 1.) for example). Change-Id: Idab668d417a148bffe2495009ae700de980b73cc Task-number: QTBUG-47319 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpdf.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 6ea0800538..54e656e339 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1979,8 +1979,8 @@ int QPdfEnginePrivate::createShadingFunction(const QGradient *gradient, int from
if (reflect && step % 2) {
for (int i = stops.size() - 1; i > 0; --i) {
QGradientBound b;
- b.start = step + 1 - qBound(0., stops.at(i).first, 1.);
- b.stop = step + 1 - qBound(0., stops.at(i - 1).first, 1.);
+ b.start = step + 1 - qBound(qreal(0.), stops.at(i).first, qreal(1.));
+ b.stop = step + 1 - qBound(qreal(0.), stops.at(i - 1).first, qreal(1.));
b.function = functions.at(i - 1);
b.reverse = true;
gradientBounds << b;
@@ -1988,8 +1988,8 @@ int QPdfEnginePrivate::createShadingFunction(const QGradient *gradient, int from
} else {
for (int i = 0; i < stops.size() - 1; ++i) {
QGradientBound b;
- b.start = step + qBound(0., stops.at(i).first, 1.);
- b.stop = step + qBound(0., stops.at(i + 1).first, 1.);
+ b.start = step + qBound(qreal(0.), stops.at(i).first, qreal(1.));
+ b.stop = step + qBound(qreal(0.), stops.at(i + 1).first, qreal(1.));
b.function = functions.at(i);
b.reverse = false;
gradientBounds << b;