Skip to content

Commit

Permalink
[afs] Correctly set picture marker size aspect ratio lock on load
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 6, 2018
1 parent b954008 commit 89e9895
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/arcgisrest/qgsarcgisrestutils.cpp
Expand Up @@ -708,7 +708,11 @@ std::unique_ptr<QgsMarkerSymbol> QgsArcGisRestUtils::parseEsriPictureMarkerSymbo
QgsSymbolLayerList layers;
std::unique_ptr< QgsRasterMarkerSymbolLayer > markerLayer = qgis::make_unique< QgsRasterMarkerSymbolLayer >( symbolPath, widthInPixels, angleCW, QgsSymbol::ScaleArea );
markerLayer->setSizeUnit( QgsUnitTypes::RenderPixels );
markerLayer->setFixedAspectRatio( static_cast< double >( widthInPixels ) / heightInPixels );

// only change the default aspect ratio if the server height setting requires this
if ( !qgsDoubleNear( static_cast< double >( widthInPixels ) / heightInPixels, markerLayer->defaultAspectRatio() ) )
markerLayer->setFixedAspectRatio( static_cast< double >( widthInPixels ) / heightInPixels );

markerLayer->setOffset( QPointF( xOffset, yOffset ) );
markerLayer->setOffsetUnit( QgsUnitTypes::RenderPoints );
layers.append( markerLayer.release() );
Expand Down

0 comments on commit 89e9895

Please sign in to comment.