From 9ccc1380f6c78f3eee6ea9ae63414ceea4ba539d Mon Sep 17 00:00:00 2001 From: Till Theato Date: Fri, 31 Dec 2010 16:41:48 +0000 Subject: [PATCH] =?utf8?q?B=C3=A9zier=20spline=20widget:=20-=20use=20rotat?= =?utf8?q?ed=20(90=C2=B0)=20rectangle=20for=20handles=20-=20highlight=20se?= =?utf8?q?lected=20point?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/trunk/kdenlive/; revision=5226 --- src/beziercurve/beziersplinewidget.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/beziercurve/beziersplinewidget.cpp b/src/beziercurve/beziersplinewidget.cpp index 3ec2bc2a..8cfab986 100644 --- a/src/beziercurve/beziersplinewidget.cpp +++ b/src/beziercurve/beziersplinewidget.cpp @@ -86,14 +86,24 @@ void BezierSplineWidget::paintEvent(QPaintEvent* event) // Drawing curve handles. p.setPen(QPen(Qt::red, 1, Qt::SolidLine)); BPoint point; + QPolygon handle(4); + handle.setPoints(4, + 0, 0, + 3, 3, + 0, 6, + -3, 3); for (int i = 0; i < m_spline.points().count(); ++i) { point = m_spline.points().at(i); - p.drawEllipse(QRectF(point.h1.x() * wWidth - 3, - wHeight - 3 - point.h1.y() * wHeight, 6, 6)); + if (i == m_currentPointIndex) + p.setBrush(QBrush(QColor(Qt::red), Qt::SolidPattern)); + + p.drawPolygon(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)); - p.drawEllipse(QRectF(point.h2.x() * wWidth - 3, - wHeight - 3 - point.h2.y() * wHeight, 6, 6)); + wHeight - 3 - point.p.y() * wHeight, 6, 6)); + p.drawPolygon(handle.translated(point.h2.x() * wWidth, wHeight - point.h2.y() * wHeight)); + + if ( i == m_currentPointIndex) + p.setBrush(QBrush(Qt::NoBrush)); } } -- 2.39.5