Fixed odom cache overlay not visible

This commit is contained in:
matlabbe
2025-11-23 11:33:26 -08:00
parent e75baec73e
commit 0bf2160939
+6 -1
View File
@@ -803,10 +803,15 @@ void GraphViewer::updateGraph(const std::map<int, Transform> & poses,
{ {
(--_nodeItems.end()).value()->setColor(_nodeOdomCacheColor); (--_nodeItems.end()).value()->setColor(_nodeOdomCacheColor);
} }
QRectF rect = this->scene()->sceneRect();
if(!odomCacheIds.empty())
_odomCacheOverlay->setRect(rect);
else
_odomCacheOverlay->setRect(0, 0, 0, 0);
if(wasEmpty) if(wasEmpty)
{ {
QRectF rect = this->scene()->sceneRect();
this->fitInView(rect.adjusted(-rect.width()/2.0f, -rect.height()/2.0f, rect.width()/2.0f, rect.height()/2.0f), Qt::KeepAspectRatio); this->fitInView(rect.adjusted(-rect.width()/2.0f, -rect.height()/2.0f, rect.width()/2.0f, rect.height()/2.0f), Qt::KeepAspectRatio);
} }