]> git.sesse.net Git - kdenlive/commitdiff
Bézier spline: Connect Handle1 + Point and Handle2+Point of the selected point with...
authorTill Theato <root@ttill.de>
Sat, 1 Jan 2011 21:25:41 +0000 (21:25 +0000)
committerTill Theato <root@ttill.de>
Sat, 1 Jan 2011 21:25:41 +0000 (21:25 +0000)
svn path=/trunk/kdenlive/; revision=5234

src/beziercurve/beziersplineeditor.cpp

index 351a6c6121b8f9985fc7224d814eddd7289ef8e0..94cbbdaf0e0b56eb0b568f89c3023be6778a4c6e 100644 (file)
@@ -75,6 +75,12 @@ void BezierSplineEditor::paintEvent(QPaintEvent* event)
     int    wWidth = width() - 1;
     int    wHeight = height() - 1;
 
+    /*
+     * Standard line
+     */
+    /*p.setPen(QPen(Qt::gray, 1, Qt::SolidLine));
+    p.drawLine(QLineF(0, wHeight, wWidth, 0));*/
+
     /*
      * Spline
      */
@@ -115,12 +121,15 @@ void BezierSplineEditor::paintEvent(QPaintEvent* event)
                      -2, 1);
     for (int i = 0; i < m_spline.points().count(); ++i) {
         point = m_spline.points().at(i);
-        if (i == m_currentPointIndex)
+        if (i == m_currentPointIndex) {
             p.setBrush(QBrush(QColor(Qt::red), Qt::SolidPattern));
+            p.drawLine(QLineF(point.h1.x() * wWidth, wHeight - point.h1.y() * wHeight, point.p.x() * wWidth, wHeight - point.p.y() * wHeight));
+            p.drawLine(QLineF(point.p.x() * wWidth, wHeight - point.p.y() * wHeight, point.h2.x() * wWidth, wHeight - point.h2.y() * wHeight));
+        }
 
-        p.drawConvexPolygon(handle.translated(point.h1.x() * wWidth, wHeight - point.h1.y() * wHeight));
         p.drawEllipse(QRectF(point.p.x() * wWidth - 3,
-                            wHeight - 3 - point.p.y() * wHeight, 6, 6));
+                     wHeight - 3 - point.p.y() * wHeight, 6, 6));
+        p.drawConvexPolygon(handle.translated(point.h1.x() * wWidth, wHeight - point.h1.y() * wHeight));
         p.drawConvexPolygon(handle.translated(point.h2.x() * wWidth, wHeight - point.h2.y() * wHeight));
 
         if ( i == m_currentPointIndex)