]> git.sesse.net Git - kdenlive/blobdiff - src/keyframehelper.cpp
fix crash when starting under macOSX
[kdenlive] / src / keyframehelper.cpp
index c46928a7facf46ac6c351344f56c6b0fb4ac7926..c77c4da477d34f9a7832d7be63247cb3c6a35a0f 100644 (file)
@@ -72,21 +72,24 @@ void KeyframeHelper::paintEvent(QPaintEvent *e) {
     m_scale = (double) width() / m_length;
     if (m_geom != NULL) {
         int pos = 0;
-        p.setBrush(QColor(255, 20, 20));
+        p.setPen(QColor(255, 20, 20));
         Mlt::GeometryItem item;
         while (true) {
             if (m_geom->next_key(&item, pos) == 1) break;
             pos = item.frame();
             int scaledPos = pos * m_scale;
-            p.drawLine(scaledPos, clipRect.y() , scaledPos, clipRect.bottom());
+            p.drawLine(scaledPos, 0, scaledPos, 10);
             //p.fillRect(QRect(scaledPos - 1, 0, 2, 15), QBrush(QColor(255, 20, 20)));
             pos++;
         }
     }
+    p.setPen(palette().dark().color());
+    p.drawLine(clipRect.x(), 5, clipRect.right(), 5);
+
     // draw pointer
     QPolygon pa(3);
     const int cursor = m_position * m_scale;
-    pa.setPoints(3, cursor - 5, 14, cursor + 5, 14, cursor/*+0*/, 9);
+    pa.setPoints(3, cursor - 5, 11, cursor + 5, 11, cursor/*+0*/, 6);
     p.setBrush(palette().dark().color());
     p.drawPolygon(pa);
 
@@ -98,7 +101,7 @@ const int KeyframeHelper::value() const {
 }
 
 void KeyframeHelper::setValue(const int pos) {
-    if (pos == m_position) return;
+    if (pos == m_position || m_geom == NULL) return;
     m_position = pos;
     update();
 }