Skip to content
Permalink
Browse files

[afs] Correctly set picture marker size aspect ratio lock on load

  • Loading branch information
nyalldawson committed Dec 6, 2018
1 parent b954008 commit 89e98957428e8a55ddee841155d8103f4afa6b63
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/providers/arcgisrest/qgsarcgisrestutils.cpp
@@ -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() );

0 comments on commit 89e9895

Please sign in to comment.
You can’t perform that action at this time.