From 9ceabab13162bdc1edd7c1e9829e8acdf3c2be9a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 27 Aug 2021 18:34:37 +0300 Subject: [PATCH] Handle cases when need to resize the scene size. --- src/app/puzzle/scene/vpmaingraphicsview.cpp | 2 ++ src/app/puzzle/vpmainwindow.cpp | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/app/puzzle/scene/vpmaingraphicsview.cpp b/src/app/puzzle/scene/vpmaingraphicsview.cpp index 074f3b5ba..6fd93d4bd 100644 --- a/src/app/puzzle/scene/vpmaingraphicsview.cpp +++ b/src/app/puzzle/scene/vpmaingraphicsview.cpp @@ -682,4 +682,6 @@ void VPMainGraphicsView::on_PieceSheetChanged(const VPPiecePtr &piece) } scene()->addItem(_graphicsPiece); } + + VMainGraphicsView::NewSceneRect(scene(), this); } diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index b992e99fc..aceebe2ea 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -799,6 +799,7 @@ void VPMainWindow::InitPropertyTabTiles() LayoutWasSaved(false); m_tileFactory->refreshTileInfos(); m_graphicsView->RefreshLayout(); + VMainGraphicsView::NewSceneRect(m_graphicsView->scene(), m_graphicsView); } }); @@ -810,6 +811,7 @@ void VPMainWindow::InitPropertyTabTiles() m_layout->LayoutSettings().SetShowTiles(checked); LayoutWasSaved(false); m_graphicsView->RefreshLayout(); + VMainGraphicsView::NewSceneRect(m_graphicsView->scene(), m_graphicsView); } }); } @@ -1785,6 +1787,8 @@ void VPMainWindow::SheetPaperSizeChanged() sheet->ValidatePiecesOutOfBound(); } } + + VMainGraphicsView::NewSceneRect(m_graphicsView->scene(), m_graphicsView); } //--------------------------------------------------------------------------------------------------------------------- @@ -1799,6 +1803,8 @@ void VPMainWindow::TilePaperSizeChanged() ui->toolButtonTileLandscapeOrientation->blockSignals(true); ui->toolButtonTileLandscapeOrientation->setChecked(not portrait); ui->toolButtonTileLandscapeOrientation->blockSignals(false); + + VMainGraphicsView::NewSceneRect(m_graphicsView->scene(), m_graphicsView); } //--------------------------------------------------------------------------------------------------------------------- @@ -2342,6 +2348,8 @@ void VPMainWindow::on_TilesMarginChanged() m_tileFactory->refreshTileInfos(); m_graphicsView->RefreshLayout(); } + + VMainGraphicsView::NewSceneRect(m_graphicsView->scene(), m_graphicsView); } //---------------------------------------------------------------------------------------------------------------------