]> git.sesse.net Git - kdenlive/commitdiff
Bézier spline widget: When moving a point also move its handles
authorTill Theato <root@ttill.de>
Sat, 1 Jan 2011 12:38:06 +0000 (12:38 +0000)
committerTill Theato <root@ttill.de>
Sat, 1 Jan 2011 12:38:06 +0000 (12:38 +0000)
svn path=/trunk/kdenlive/; revision=5231

src/beziercurve/beziersplinewidget.cpp

index 8f6eff0de98102de8b4656fa63af9f6271ebe55e..efc9b00089beaa03f8637e43543c51042ecf842e 100644 (file)
@@ -179,7 +179,7 @@ void BezierSplineWidget::mousePressEvent(QMouseEvent* event)
             point.h2 = QPointF(x + m_grabOffsetX, y + m_grabOffsetY);
     }
     m_spline.setPoint(m_currentPointIndex, point);
-    
+
     //d->m_draggedAwayPointIndex = -1;
 
     m_mode = ModeDrag;
@@ -266,6 +266,11 @@ void BezierSplineWidget::mouseMoveEvent(QMouseEvent* event)
             }
             x = qBound(leftX, x, rightX);
             y = qBound(0., y, 1.);
+
+            // move handles by same offset
+            point.h1 += QPointF(x, y) - point.p;
+            point.h2 += QPointF(x, y) - point.p;
+
             point.p = QPointF(x, y);
             break;
         case PTypeH2: