Fixed how images are scaled to handle images with different size

This commit is contained in:
matlabbe
2015-05-26 14:15:04 -04:00
parent 13af312b03
commit e6923daf1c
3 changed files with 31 additions and 16 deletions

View File

@@ -127,6 +127,11 @@ void ImageView::loadSettings(QSettings & settings, const QString & group)
}
}
QRectF ImageView::sceneRect() const
{
return _graphicsView->scene()->sceneRect();
}
bool ImageView::isImageShown() const
{
return _showImage->isChecked();
@@ -770,6 +775,9 @@ void ImageView::clear()
}
_imageDepth = QPixmap();
_graphicsView->scene()->setSceneRect(QRectF());
_graphicsView->setScene(_graphicsView->scene());
if(!_graphicsView->isVisible())
{
this->update();