]> git.sesse.net Git - kdenlive/blobdiff - src/vectorscope.cpp
Remember render settings for project (zone, guides,...):
[kdenlive] / src / vectorscope.cpp
index 7a966e3ad2c35b452c653d39e38ecd55662857cc..cca16ef1dfca189071cf18d8bf751386e54b8536 100644 (file)
@@ -26,7 +26,6 @@
 
 const float P75 = .75;
 const unsigned char DEFAULT_Y = 255;
-//const unsigned int REALTIME_FPS = 15; // in fps.
 
 const QPointF YUV_R(-.147,  .615);
 const QPointF YUV_G(-.289, -.515);
@@ -114,28 +113,24 @@ Vectorscope::~Vectorscope()
     delete m_a75PBox;
 }
 
-QString Vectorscope::widgetName() const {
-    return QString("Vectorscope");
-}
+QString Vectorscope::widgetName() const { return QString("Vectorscope"); }
 
 QRect Vectorscope::scopeRect()
 {
-    // Widget width/height
-    int ww = this->size().width();
-    int wh = this->size().height();
-
     // Distance from top/left/right
     int offset = 6;
 
     // We want to paint below the controls area. The line is the lowest element.
-    QPoint topleft(offset, ui->line->y()+offset);
+    QPoint topleft(offset, ui->verticalSpacer->geometry().y()+offset);
+    QPoint bottomright(ui->horizontalSpacer->geometry().right()-offset, this->size().height()-offset);
+
+    QRect scopeRect(topleft, bottomright);
 
     // Circle Width: min of width and height
-    cw = wh - topleft.y();
-    if (ww < cw) { cw = ww; }
-    cw -= 2*offset;
+    cw = (scopeRect.height() < scopeRect.width()) ? scopeRect.height() : scopeRect.width();
+    scopeRect.setWidth(cw);
+    scopeRect.setHeight(cw);
 
-    QRect scopeRect(topleft, QPoint(cw, cw) + topleft);
 
     m_centerPoint = m_vectorscopeGenerator->mapToCircle(scopeRect.size(), QPointF(0,0));
     pR75 = m_vectorscopeGenerator->mapToCircle(scopeRect.size(), P75*VectorscopeGenerator::scaling*YUV_R);