Skip to content

Commit

Permalink
[Bugfix][Server][GetPrint] Correctly set way to draw selection in lay…
Browse files Browse the repository at this point in the history
…out settings
  • Loading branch information
rldhont committed Oct 26, 2018
1 parent eae047e commit 91c19ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -413,6 +413,8 @@ namespace QgsWms
dpi = _dpi;
}
exportSettings.dpi = dpi;
// Draw selections
exportSettings.flags |= QgsLayoutRenderContext::FlagDrawSelection;
// Destination image size in px
QgsLayoutSize layoutSize( layout->pageCollection()->page( 0 )->sizeWithUnits() );
QgsLayoutMeasurement width( layout->convertFromLayoutUnits( layoutSize.width(), QgsUnitTypes::LayoutUnit::LayoutMillimeters ) );
Expand All @@ -435,6 +437,8 @@ namespace QgsWms
if ( ok )
exportSettings.dpi = dpi;
}
// Draw selections
exportSettings.flags |= QgsLayoutRenderContext::FlagDrawSelection;
// Export all pages
QgsLayoutExporter exporter( layout.get() );
exporter.exportToPdf( tempOutputFile.fileName(), exportSettings );
Expand All @@ -450,8 +454,6 @@ namespace QgsWms

bool QgsRenderer::configurePrintLayout( QgsPrintLayout *c, const QgsMapSettings &mapSettings )
{
c->renderContext().setSelectionColor( mapSettings.selectionColor() );
c->renderContext().setFlag( QgsLayoutRenderContext::FlagDrawSelection, true );
// Maps are configured first
QList<QgsLayoutItemMap *> maps;
c->layoutItems<QgsLayoutItemMap>( maps );
Expand Down

0 comments on commit 91c19ff

Please sign in to comment.