mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-02 09:00:14 -06:00
Multi plot: Fix rendering of single plots to PDF
This commit is contained in:
1 parent
1885d8bd6e
commit
185b26514b
1 file changed
+15
-4
@@ -23,6 +23,7 @@
|
||||
#include "RiaPlotWindowRedrawScheduler.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiPlotWindow.h"
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimViewWindow.h"
|
||||
@@ -105,10 +106,20 @@ void RicSnapshotViewToFileFeature::savePlotPDFReportAs( const QString& fileName,
|
||||
pdfPrinter.setCreator( QCoreApplication::applicationName() );
|
||||
pdfPrinter.setResolution( resolution );
|
||||
QRect widgetRect = plot->viewWidget()->contentsRect();
|
||||
QRect pageRect = pdfPrinter.pageLayout().fullRectPixels( resolution );
|
||||
plot->viewWidget()->resize( pageRect.size() );
|
||||
plot->renderWindowContent( &pdfPrinter );
|
||||
plot->viewWidget()->resize( widgetRect.size() );
|
||||
if ( dynamic_cast<RimMultiPlotWindow*>( plot ) )
|
||||
{
|
||||
QRect pageRect = pdfPrinter.pageLayout().fullRectPixels( resolution );
|
||||
plot->viewWidget()->resize( pageRect.size() );
|
||||
plot->renderWindowContent( &pdfPrinter );
|
||||
plot->viewWidget()->resize( widgetRect.size() );
|
||||
}
|
||||
else
|
||||
{
|
||||
QRect pageRect = pdfPrinter.pageLayout().paintRectPixels( resolution );
|
||||
plot->viewWidget()->resize( pageRect.size() );
|
||||
plot->renderWindowContent( &pdfPrinter );
|
||||
plot->viewWidget()->resize( widgetRect.size() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user