]> git.sesse.net Git - kdenlive/blobdiff - src/waveform.cpp
Waveform and RGB Parade:
[kdenlive] / src / waveform.cpp
index cb7dcf5c15b96744b6afdfa8e0b2ca240663bdfc..505c972f7791416c7d654a2a4979809df571781a 100644 (file)
@@ -119,8 +119,17 @@ QImage Waveform::renderHUD(uint)
         // and show the value of the waveform there
         davinci.drawLine(0, y, scopeRect().size().width()-m_textWidth.width(), y);
 
+        // Make the value stick to the line unless it is at the top/bottom of the scope
+        const int top = 30;
+        const int bottom = 20;
+        int valY = y+5;
+        if (valY < top) {
+            valY = top;
+        } else if (valY > scopeRect().height()-bottom) {
+            valY = scopeRect().height()-bottom;
+        }
         int val = 255*(1-(float)y/scopeRect().height());
-        davinci.drawText(x, scopeRect().height()/2, QVariant(val).toString());
+        davinci.drawText(x, valY, QVariant(val).toString());
     }
     davinci.drawText(x, scopeRect().height(), "0");
     davinci.drawText(x, 10, "255");