Skip to content

Commit cabff38

Browse files
committed
Fix resolution in image export
1 parent b45d853 commit cabff38

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/app/composer/qgscomposer.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,9 @@ void QgsComposer::on_mActionExportAsImage_triggered()
705705
return;
706706
}
707707

708+
QgsComposition::PlotStyle savedPlotStyle = mComposition->plotStyle();
709+
mComposition->setPlotStyle( QgsComposition::Print );
710+
708711
for ( int i = 0; i < mComposition->numPages(); ++i )
709712
{
710713
QImage image = printPageAsRaster( i );
@@ -719,6 +722,8 @@ void QgsComposer::on_mActionExportAsImage_triggered()
719722
image.save( outputFilePath, fileNExt.second.toLocal8Bit().constData() );
720723
}
721724
}
725+
726+
mComposition->setPlotStyle( savedPlotStyle );
722727
}
723728

724729

@@ -772,6 +777,8 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
772777
}
773778

774779
settings.setValue( "/UI/lastSaveAsSvgFile", outputFileName );
780+
781+
QgsComposition::PlotStyle savedPlotStyle = mComposition->plotStyle();
775782
mComposition->setPlotStyle( QgsComposition::Print );
776783

777784
mView->setPaintingEnabled( false );
@@ -805,8 +812,9 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
805812

806813
mComposition->renderPage( &p, i );
807814
p.end();
808-
mComposition->setPlotStyle( QgsComposition::Preview );
809815
}
816+
817+
mComposition->setPlotStyle( savedPlotStyle );
810818
mView->setPaintingEnabled( true );
811819
}
812820

0 commit comments

Comments
 (0)