diff --git a/ApplicationLibCode/CommandFileInterface/RicfExportSnapshots.cpp b/ApplicationLibCode/CommandFileInterface/RicfExportSnapshots.cpp index 5b7002da9a..012a09565d 100644 --- a/ApplicationLibCode/CommandFileInterface/RicfExportSnapshots.cpp +++ b/ApplicationLibCode/CommandFileInterface/RicfExportSnapshots.cpp @@ -91,11 +91,6 @@ caf::PdmScriptResponse RicfExportSnapshots::execute() RiuMainWindow* mainWnd = RiuMainWindow::instance(); CVF_ASSERT( mainWnd ); - // QByteArray curState = mainWnd->dockManager()->saveState( 0 ); - // mainWnd->dockManager()->restoreState( RiuDockWidgetTools::defaultDockState( RiuDockWidgetTools::dockStateHideAll3DWindowName() ) ); - - // QApplication::processEvents(); - QString absolutePathToSnapshotDir = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::SNAPSHOTS ); if ( !m_exportFolder().isEmpty() ) @@ -147,9 +142,5 @@ caf::PdmScriptResponse RicfExportSnapshots::execute() fileSuffix ); } - QApplication::processEvents(); - - // mainWnd->dockManager()->restoreState( curState ); - return caf::PdmScriptResponse(); } diff --git a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp index 51c130827b..b4c726e935 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp @@ -113,10 +113,17 @@ void RicSnapshotViewToFileFeature::savePlotPdfReportAs( const QString& fileName, else { QRect pageRect = pdfPrinter.pageLayout().paintRectPixels( resolution ); - viewWidget->resize( pageRect.size() ); + viewWidget->setFixedSize( pageRect.size() ); plot->renderWindowContent( &pdfPrinter ); + viewWidget->setMinimumSize( 0, 0 ); + viewWidget->setMaximumSize( QWIDGETSIZE_MAX, QWIDGETSIZE_MAX ); viewWidget->resize( widgetRect.size() ); } + + if ( multiPlot ) + { + multiPlot->updateLayout(); + } } else { diff --git a/ApplicationLibCode/ProjectDataModel/RimPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimPlot.cpp index 8a10cd851c..e1c7f5b51a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlot.cpp @@ -196,7 +196,8 @@ void RimPlot::doRenderWindowContent( QPaintDevice* paintDevice ) { if ( plotWidget() ) { - plotWidget()->renderTo( paintDevice, plotWidget()->frameGeometry() ); + auto rect = plotWidget()->frameGeometry(); + plotWidget()->renderTo( paintDevice, rect ); } }