From 7f3f4245303a77758b8589d78c2c492d589a4d67 Mon Sep 17 00:00:00 2001 From: Till Theato Date: Sat, 19 Feb 2011 23:23:02 +0000 Subject: [PATCH] Fix compile with Qt < 4.6 ... svn path=/trunk/kdenlive/; revision=5433 --- src/onmonitoritems/rotoscoping/splineitem.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/onmonitoritems/rotoscoping/splineitem.cpp b/src/onmonitoritems/rotoscoping/splineitem.cpp index ee29f159..f9a7d579 100644 --- a/src/onmonitoritems/rotoscoping/splineitem.cpp +++ b/src/onmonitoritems/rotoscoping/splineitem.cpp @@ -249,7 +249,11 @@ int SplineItem::getClosestPointOnCurve(QPointF point, double *tFinal) p2 = qgraphicsitem_cast(childItems().at(j))->getPoint(); QPolygonF bounding = QPolygonF() << p1.p << p1.h2 << p2.h1 << p2.p; QPointF cl = closestPointInRect(point, bounding.boundingRect()); +#if QT_VERSION >= 0x040600 qreal d = (point - cl).manhattanLength(); +#else + qreal d = qAbs((point - cl).x()) + qAbs((point - cl).y()); +#endif if (d > diff) continue; @@ -273,7 +277,11 @@ int SplineItem::getClosestPointOnCurve(QPointF point, double *tFinal) cl.setX(n.x); cl.setY(n.y); +#if QT_VERSION >= 0x040600 d = (point - cl).manhattanLength(); +#else + d = qAbs((point - cl).x()) + qAbs((point - cl).y()); +#endif if (d < diff) { diff = d; param = t; -- 2.39.2