Skip to content

Commit e6fcadc

Browse files
committed
Clean up PDF snapshots a bit
1 parent c449805 commit e6fcadc

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

ApplicationLibCode/CommandFileInterface/RicfExportSnapshots.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
9191
RiuMainWindow* mainWnd = RiuMainWindow::instance();
9292
CVF_ASSERT( mainWnd );
9393

94-
// QByteArray curState = mainWnd->dockManager()->saveState( 0 );
95-
// mainWnd->dockManager()->restoreState( RiuDockWidgetTools::defaultDockState( RiuDockWidgetTools::dockStateHideAll3DWindowName() ) );
96-
97-
// QApplication::processEvents();
98-
9994
QString absolutePathToSnapshotDir = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::SNAPSHOTS );
10095

10196
if ( !m_exportFolder().isEmpty() )
@@ -147,9 +142,5 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
147142
fileSuffix );
148143
}
149144

150-
QApplication::processEvents();
151-
152-
// mainWnd->dockManager()->restoreState( curState );
153-
154145
return caf::PdmScriptResponse();
155146
}

ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,17 @@ void RicSnapshotViewToFileFeature::savePlotPdfReportAs( const QString& fileName,
113113
else
114114
{
115115
QRect pageRect = pdfPrinter.pageLayout().paintRectPixels( resolution );
116-
viewWidget->resize( pageRect.size() );
116+
viewWidget->setFixedSize( pageRect.size() );
117117
plot->renderWindowContent( &pdfPrinter );
118+
viewWidget->setMinimumSize( 0, 0 );
119+
viewWidget->setMaximumSize( QWIDGETSIZE_MAX, QWIDGETSIZE_MAX );
118120
viewWidget->resize( widgetRect.size() );
119121
}
122+
123+
if ( multiPlot )
124+
{
125+
multiPlot->updateLayout();
126+
}
120127
}
121128
else
122129
{

ApplicationLibCode/ProjectDataModel/RimPlot.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ void RimPlot::doRenderWindowContent( QPaintDevice* paintDevice )
196196
{
197197
if ( plotWidget() )
198198
{
199-
plotWidget()->renderTo( paintDevice, plotWidget()->frameGeometry() );
199+
auto rect = plotWidget()->frameGeometry();
200+
plotWidget()->renderTo( paintDevice, rect );
200201
}
201202
}
202203

0 commit comments

Comments
 (0)