fixed GraphView scene size to include the grid map too

This commit is contained in:
Mathieu Labbe
2015-02-23 15:48:25 -05:00
parent 38a4e8e4ee
commit 529248a227
2 changed files with 3 additions and 1 deletions

View File

@@ -393,6 +393,7 @@ void GraphViewer::updateMap(const cv::Mat & map8U, float resolution, float xMin,
_gridMap->setRotation(90);
_gridMap->setPixmap(QPixmap::fromImage(image));
_gridMap->setPos(-yMin, -xMin);
this->scene()->setSceneRect(this->scene()->itemsBoundingRect()); // Re-shrink the scene to it's bounding contents
}
else
{
@@ -468,6 +469,7 @@ void GraphViewer::clearMap()
{
_gridMap->setPixmap(QPixmap());
_gridCellSize = 0.0f;
this->scene()->setSceneRect(this->scene()->itemsBoundingRect()); // Re-shrink the scene to it's bounding contents
}
void GraphViewer::clearPosterior()