]> git.sesse.net Git - kdenlive/commitdiff
Fix compile with Qt < 4.6 ...
authorTill Theato <root@ttill.de>
Sat, 19 Feb 2011 23:23:02 +0000 (23:23 +0000)
committerTill Theato <root@ttill.de>
Sat, 19 Feb 2011 23:23:02 +0000 (23:23 +0000)
svn path=/trunk/kdenlive/; revision=5433

src/onmonitoritems/rotoscoping/splineitem.cpp

index ee29f159dfaf571ba435c9ecc82601d6ad8efcad..f9a7d57963dc9f7645758e32f9d163852f3419ab 100644 (file)
@@ -249,7 +249,11 @@ int SplineItem::getClosestPointOnCurve(QPointF point, double *tFinal)
         p2 = qgraphicsitem_cast<BPointItem *>(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;