Fixed GraphView re-scaled when ground truth is null. PreferencesDialog: fixed a bug where some parameters were wrongly modified by default values in the *.ui (blocking signals when setParameter() is called to avoid addParameter() to be called)

This commit is contained in:
matlabbe
2016-01-14 15:30:52 -05:00
parent 2ae1b84f85
commit 1010f6acff
2 changed files with 25 additions and 20 deletions

View File

@@ -574,12 +574,15 @@ void GraphViewer::updateGTGraph(const std::map<int, Transform> & poses)
}
}
this->scene()->setSceneRect(this->scene()->itemsBoundingRect()); // Re-shrink the scene to it's bounding contents
if(wasEmpty)
if(_gtNodeItems.size() || _gtLinkItems.size())
{
QRectF rect = this->scene()->itemsBoundingRect();
this->fitInView(rect.adjusted(-rect.width()/2.0f, -rect.height()/2.0f, rect.width()/2.0f, rect.height()/2.0f), Qt::KeepAspectRatio);
this->scene()->setSceneRect(this->scene()->itemsBoundingRect()); // Re-shrink the scene to it's bounding contents
if(wasEmpty)
{
QRectF rect = this->scene()->itemsBoundingRect();
this->fitInView(rect.adjusted(-rect.width()/2.0f, -rect.height()/2.0f, rect.width()/2.0f, rect.height()/2.0f), Qt::KeepAspectRatio);
}
}
UDEBUG("_gtNodeItems=%d, _gtLinkItems=%d", _gtNodeItems.size(), _gtLinkItems.size());