From 858d442f23c890f2973067d9b49a33da6e674de2 Mon Sep 17 00:00:00 2001 From: Till Theato Date: Sat, 1 Jan 2011 12:38:06 +0000 Subject: [PATCH] =?utf8?q?B=C3=A9zier=20spline=20widget:=20When=20moving?= =?utf8?q?=20a=20point=20also=20move=20its=20handles?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/trunk/kdenlive/; revision=5231 --- src/beziercurve/beziersplinewidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/beziercurve/beziersplinewidget.cpp b/src/beziercurve/beziersplinewidget.cpp index 8f6eff0d..efc9b000 100644 --- a/src/beziercurve/beziersplinewidget.cpp +++ b/src/beziercurve/beziersplinewidget.cpp @@ -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: -- 2.39.2