summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Powell <jeremy@visionaid.com>2019-04-23 10:40:05 +1200
committerRebecca Worledge <rebecca.worledge@theqtcompany.com>2019-04-29 23:04:49 +0000
commit254ea99abd181abe5468b7cc5ece0e2ae51da185 (patch)
tree733869b2746e86767ee79439c452dbf4f56e3bf1
parent80151882a9a806f5fdbb700fd6a0db1300d9d5e0 (diff)
Fix building with qreal float
Change-Id: Id190122381f3d76f242c097b9d6afb793251aaaa Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Rebecca Worledge <rebecca.worledge@theqtcompany.com>
-rw-r--r--src/bodymovin/beziereasing.cpp2
-rw-r--r--src/bodymovin/bmproperty_p.h2
-rw-r--r--src/bodymovin/trimpath.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/bodymovin/beziereasing.cpp b/src/bodymovin/beziereasing.cpp
index 5a76531..a14db8a 100644
--- a/src/bodymovin/beziereasing.cpp
+++ b/src/bodymovin/beziereasing.cpp
@@ -39,7 +39,7 @@ void BezierEasing::addCubicBezierSegment(const QPointF &c1, const QPointF &c2, c
qreal BezierEasing::valueForProgress(qreal progress) const
{
qreal res = mBezier.pointAt(tForX(progress)).y();
- return qBound(0.0, res, 1.0);
+ return qBound(qreal(0.0), res, qreal(1.0));
}
qreal BezierEasing::tForX(qreal x) const
diff --git a/src/bodymovin/bmproperty_p.h b/src/bodymovin/bmproperty_p.h
index 6f00468..5ab4a7a 100644
--- a/src/bodymovin/bmproperty_p.h
+++ b/src/bodymovin/bmproperty_p.h
@@ -366,7 +366,7 @@ public:
qreal easedValue = easing->easing.valueForProgress(progress);
// For the time being, 4D vectors are used only for colors, and
// the value must be restricted to between [0, 1]
- easedValue = qBound(0.0, easedValue, 1.0);
+ easedValue = qBound(qreal(0.0), easedValue, qreal(1.0));
T sv = easing->startValue;
T ev = easing->endValue;
qreal x = sv.x() + easedValue * (ev.x() - sv.x());
diff --git a/src/bodymovin/trimpath.cpp b/src/bodymovin/trimpath.cpp
index 1cd124b..d02b52c 100644
--- a/src/bodymovin/trimpath.cpp
+++ b/src/bodymovin/trimpath.cpp
@@ -44,8 +44,8 @@ QPainterPath TrimPath::trimmed(qreal f1, qreal f2, qreal offset) const
if (mPath.isEmpty() || !mPath.elementAt(0).isMoveTo())
return res;
- f1 = qBound(0.0, f1, 1.0);
- f2 = qBound(0.0, f2, 1.0);
+ f1 = qBound(qreal(0.0), f1, qreal(1.0));
+ f2 = qBound(qreal(0.0), f2, qreal(1.0));
if (qFuzzyCompare(f1, f2))
return res;
if (f1 > f2)
@@ -54,7 +54,7 @@ QPainterPath TrimPath::trimmed(qreal f1, qreal f2, qreal offset) const
return mPath;
qreal dummy;
- offset = modf(offset, &dummy); // Use only the fractional part of offset, range <-1, 1>
+ offset = std::modf(offset, &dummy); // Use only the fractional part of offset, range <-1, 1>
qreal of1 = f1 + offset;
qreal of2 = f2 + offset;