]> git.sesse.net Git - kdenlive/blobdiff - src/beziercurve/beziersplineeditor.cpp
Fix compile warnings, based on:
[kdenlive] / src / beziercurve / beziersplineeditor.cpp
index 626ffd9734d07811d366eedb5e501b942c2121f8..67097872c9440a3c9288cb72398fd844f11c7f6b 100644 (file)
@@ -17,6 +17,7 @@
  ***************************************************************************/
 
 #include "beziersplineeditor.h"
+#include "kdenlivesettings.h"
 
 #include <QPainter>
 #include <QMouseEvent>
@@ -68,13 +69,14 @@ BPoint BezierSplineEditor::getCurrentPoint()
         return BPoint();
 }
 
-void BezierSplineEditor::updateCurrentPoint(const BPoint& p)
+void BezierSplineEditor::updateCurrentPoint(const BPoint& p, bool final)
 {
     if (m_currentPointIndex >= 0) {
         m_spline.setPoint(m_currentPointIndex, p);
         // during validation the point might have changed
         emit currentPoint(m_spline.getPoint(m_currentPointIndex));
-        emit modified();
+        if (final)
+            emit modified();
         update();
     }
 }
@@ -119,7 +121,7 @@ void BezierSplineEditor::setGridLines(int lines)
 
 void BezierSplineEditor::paintEvent(QPaintEvent* event)
 {
-    Q_UNUSED(event);
+    Q_UNUSED(event)
 
     QPainter p(this);
 
@@ -436,11 +438,13 @@ void BezierSplineEditor::mouseMoveEvent(QMouseEvent* event)
         }
 
         emit currentPoint(point);
+        if (KdenliveSettings::dragvalue_directupdate())
+            emit modified();
         update();
     }
 }
 
-void BezierSplineEditor::mouseDoubleClickEvent(QMouseEvent* event)
+void BezierSplineEditor::mouseDoubleClickEvent(QMouseEvent* /*event*/)
 {
     if (m_currentPointIndex >= 0) {
         BPoint p = m_spline.getPoint(m_currentPointIndex);
@@ -458,7 +462,7 @@ void BezierSplineEditor::leaveEvent(QEvent* event)
 int BezierSplineEditor::nearestPointInRange(QPointF p, int wWidth, int wHeight, BezierSplineEditor::point_types* sel)
 {
     double nearestDistanceSquared = 1000;
-    point_types selectedPoint;
+    point_types selectedPoint = PTypeP;
     int nearestIndex = -1;
     int i = 0;