mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Multi plot: Fix rendering of single plots to PDF
This commit is contained in:
parent
1885d8bd6e
commit
185b26514b
@ -23,6 +23,7 @@
|
|||||||
#include "RiaPlotWindowRedrawScheduler.h"
|
#include "RiaPlotWindowRedrawScheduler.h"
|
||||||
|
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimPlotWindow.h"
|
#include "RimPlotWindow.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimViewWindow.h"
|
#include "RimViewWindow.h"
|
||||||
@ -105,10 +106,20 @@ void RicSnapshotViewToFileFeature::savePlotPDFReportAs( const QString& fileName,
|
|||||||
pdfPrinter.setCreator( QCoreApplication::applicationName() );
|
pdfPrinter.setCreator( QCoreApplication::applicationName() );
|
||||||
pdfPrinter.setResolution( resolution );
|
pdfPrinter.setResolution( resolution );
|
||||||
QRect widgetRect = plot->viewWidget()->contentsRect();
|
QRect widgetRect = plot->viewWidget()->contentsRect();
|
||||||
QRect pageRect = pdfPrinter.pageLayout().fullRectPixels( resolution );
|
if ( dynamic_cast<RimMultiPlotWindow*>( plot ) )
|
||||||
plot->viewWidget()->resize( pageRect.size() );
|
{
|
||||||
plot->renderWindowContent( &pdfPrinter );
|
QRect pageRect = pdfPrinter.pageLayout().fullRectPixels( resolution );
|
||||||
plot->viewWidget()->resize( widgetRect.size() );
|
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
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user