From 529248a2270021544cc954ab4955964976bbdac7 Mon Sep 17 00:00:00 2001 From: Mathieu Labbe Date: Mon, 23 Feb 2015 15:48:25 -0500 Subject: [PATCH] fixed GraphView scene size to include the grid map too --- guilib/src/GraphViewer.cpp | 2 ++ guilib/src/MainWindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/guilib/src/GraphViewer.cpp b/guilib/src/GraphViewer.cpp index 00147ae8..70378a19 100644 --- a/guilib/src/GraphViewer.cpp +++ b/guilib/src/GraphViewer.cpp @@ -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() diff --git a/guilib/src/MainWindow.cpp b/guilib/src/MainWindow.cpp index daf479d8..0c2d9bad 100644 --- a/guilib/src/MainWindow.cpp +++ b/guilib/src/MainWindow.cpp @@ -503,7 +503,7 @@ void MainWindow::closeEvent(QCloseEvent* event) { QMessageBox::Button b=QMessageBox::question(this, tr("RTAB-Map"), - tr("There are unsaved changes. Save them?"), + tr("There are unsaved changed settings. Save them?"), QMessageBox::Save | QMessageBox::Cancel | QMessageBox::Discard); if(b == QMessageBox::Save) {