Commit 0267349b authored by Thiago Santini's avatar Thiago Santini

Allows camera widget to be larger than the actual image

parent d079d025
...@@ -476,9 +476,15 @@ void CameraWidget::updateWidgetSize(const int &width, const int &height) ...@@ -476,9 +476,15 @@ void CameraWidget::updateWidgetSize(const int &width, const int &height)
return; return;
frameSize = newFrameSize; frameSize = newFrameSize;
QSize minMaxSize = { 640 , 480 };
QSize maxSize = { 960 , 540 }; QSize maxSize = { 960 , 540 };
if (frameSize.width() < maxSize.width() && frameSize.height() < maxSize.height() ) if (frameSize.width() < maxSize.width() && frameSize.height() < maxSize.height() ) {
if (frameSize.width() < minMaxSize.width() && frameSize.height() < minMaxSize.height()) {
float ratio = minMaxSize.width() / (float) frameSize.width();
frameSize.setWidth(minMaxSize.width());
frameSize.setHeight(ratio * minMaxSize.height());
}
this->setMaximumSize( frameSize ); this->setMaximumSize( frameSize );
else } else
this->setMaximumSize( maxSize ); this->setMaximumSize( maxSize );
} }
...@@ -42,7 +42,7 @@ Synchronizer::~Synchronizer() ...@@ -42,7 +42,7 @@ Synchronizer::~Synchronizer()
void Synchronizer::newRightEyeData(EyeData eyeData) void Synchronizer::newRightEyeData(EyeData eyeData)
{ {
rEyeList.push_back(eyeData); rEyeList.emplace_back(eyeData);
if (rEyeList.size() > maxListSize) if (rEyeList.size() > maxListSize)
rEyeList.pop_front(); rEyeList.pop_front();
updated = true; updated = true;
...@@ -52,7 +52,7 @@ void Synchronizer::newRightEyeData(EyeData eyeData) ...@@ -52,7 +52,7 @@ void Synchronizer::newRightEyeData(EyeData eyeData)
void Synchronizer::newLeftEyeData(EyeData eyeData) void Synchronizer::newLeftEyeData(EyeData eyeData)
{ {
lEyeList.push_back(eyeData); lEyeList.emplace_back(eyeData);
if (lEyeList.size() > maxListSize) if (lEyeList.size() > maxListSize)
lEyeList.pop_front(); lEyeList.pop_front();
updated = true; updated = true;
...@@ -63,7 +63,7 @@ void Synchronizer::newLeftEyeData(EyeData eyeData) ...@@ -63,7 +63,7 @@ void Synchronizer::newLeftEyeData(EyeData eyeData)
void Synchronizer::newFieldData(FieldData fieldData) void Synchronizer::newFieldData(FieldData fieldData)
{ {
fieldList.push_back(fieldData); fieldList.emplace_back(fieldData);
if (fieldList.size() > maxListSize) if (fieldList.size() > maxListSize)
fieldList.pop_front(); fieldList.pop_front();
updated = true; updated = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment