From: Till Theato Date: Sat, 8 May 2010 21:55:38 +0000 (+0000) Subject: - Increase maximum size of curve widget X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=94fbfb245890626fe5c6c9a4064df4c93d24abe5;p=kdenlive - Increase maximum size of curve widget - Exclude first and last point from right click deletion in curve widget - Fix selected point index changing after deleting a point with a smaller index in curve widget svn path=/trunk/kdenlive/; revision=4423 --- diff --git a/src/kis_curve_widget.cpp b/src/kis_curve_widget.cpp index 7134adf8..821c9e23 100644 --- a/src/kis_curve_widget.cpp +++ b/src/kis_curve_widget.cpp @@ -81,7 +81,7 @@ KisCurveWidget::KisCurveWidget(QWidget *parent, Qt::WFlags f) setAutoFillBackground(false); setAttribute(Qt::WA_OpaquePaintEvent); setMinimumSize(150, 150); - setMaximumSize(250, 250); + setMaximumSize(350, 350); d->setCurveModified(); @@ -327,10 +327,12 @@ void KisCurveWidget::mousePressEvent(QMouseEvent * e) int closest_point_index = d->nearestPointInRange(QPointF(x, y), width(), height()); - if (e->button() == Qt::RightButton && closest_point_index >= 0 && d->m_curve.points().count() > 2) { + if (e->button() == Qt::RightButton && closest_point_index > 0 && closest_point_index < d->m_curve.points().count() - 1) { d->m_curve.removePoint(closest_point_index); setCursor(Qt::ArrowCursor); d->setState(ST_NORMAL); + if (closest_point_index < d->m_grab_point_index) + --d->m_grab_point_index; d->setCurveModified(); return; } else if (e->button() != Qt::LeftButton) return;