From: Till Theato Date: Sat, 1 Jan 2011 21:25:41 +0000 (+0000) Subject: Bézier spline: Connect Handle1 + Point and Handle2+Point of the selected point with... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=51440f9be2094167df5b0cbef9ba49cde5b7a3d1;p=kdenlive Bézier spline: Connect Handle1 + Point and Handle2+Point of the selected point with a line svn path=/trunk/kdenlive/; revision=5234 --- diff --git a/src/beziercurve/beziersplineeditor.cpp b/src/beziercurve/beziersplineeditor.cpp index 351a6c61..94cbbdaf 100644 --- a/src/beziercurve/beziersplineeditor.cpp +++ b/src/beziercurve/beziersplineeditor.cpp @@ -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)