X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fvectorscope.cpp;h=cca16ef1dfca189071cf18d8bf751386e54b8536;hb=7c066a50b5c795b85b4e94d489dfb18458d7ce7b;hp=7a966e3ad2c35b452c653d39e38ecd55662857cc;hpb=7f8ee4ba01ff14466c4df29e08b9784b8f0c7ba4;p=kdenlive diff --git a/src/vectorscope.cpp b/src/vectorscope.cpp index 7a966e3a..cca16ef1 100644 --- a/src/vectorscope.cpp +++ b/src/vectorscope.cpp @@ -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);