From: Till Theato Date: Sat, 19 Feb 2011 23:23:02 +0000 (+0000) Subject: Fix compile with Qt < 4.6 ... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7f3f4245303a77758b8589d78c2c492d589a4d67;p=kdenlive Fix compile with Qt < 4.6 ... svn path=/trunk/kdenlive/; revision=5433 --- 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;