From 51440f9be2094167df5b0cbef9ba49cde5b7a3d1 Mon Sep 17 00:00:00 2001 From: Till Theato Date: Sat, 1 Jan 2011 21:25:41 +0000 Subject: [PATCH] =?utf8?q?B=C3=A9zier=20spline:=20Connect=20Handle1=20+=20?= =?utf8?q?Point=20and=20Handle2+Point=20of=20the=20selected=20point=20with?= =?utf8?q?=20a=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/trunk/kdenlive/; revision=5234 --- src/beziercurve/beziersplineeditor.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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) -- 2.39.2