Skip to content

Commit 89e9895

Browse files
committed
[afs] Correctly set picture marker size aspect ratio lock on load
1 parent b954008 commit 89e9895

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/providers/arcgisrest/qgsarcgisrestutils.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,11 @@ std::unique_ptr<QgsMarkerSymbol> QgsArcGisRestUtils::parseEsriPictureMarkerSymbo
708708
QgsSymbolLayerList layers;
709709
std::unique_ptr< QgsRasterMarkerSymbolLayer > markerLayer = qgis::make_unique< QgsRasterMarkerSymbolLayer >( symbolPath, widthInPixels, angleCW, QgsSymbol::ScaleArea );
710710
markerLayer->setSizeUnit( QgsUnitTypes::RenderPixels );
711-
markerLayer->setFixedAspectRatio( static_cast< double >( widthInPixels ) / heightInPixels );
711+
712+
// only change the default aspect ratio if the server height setting requires this
713+
if ( !qgsDoubleNear( static_cast< double >( widthInPixels ) / heightInPixels, markerLayer->defaultAspectRatio() ) )
714+
markerLayer->setFixedAspectRatio( static_cast< double >( widthInPixels ) / heightInPixels );
715+
712716
markerLayer->setOffset( QPointF( xOffset, yOffset ) );
713717
markerLayer->setOffsetUnit( QgsUnitTypes::RenderPoints );
714718
layers.append( markerLayer.release() );

0 commit comments

Comments
 (0)