Skip to content
Permalink
Browse files
[afs] Fix picture marker ratio calculation
  • Loading branch information
nirvn committed Dec 10, 2018
1 parent 22a66ef commit 74172fc176ef40fa29bf2f7515696bfe4b4c4df3
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/providers/arcgisrest/qgsarcgisrestutils.cpp
  2. +1 −1 tests/src/providers/testqgsarcgisrestutils.cpp
@@ -758,8 +758,8 @@ std::unique_ptr<QgsMarkerSymbol> QgsArcGisRestUtils::parseEsriPictureMarkerSymbo
markerLayer->setSizeUnit( QgsUnitTypes::RenderPixels );

// 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 );
if ( !qgsDoubleNear( static_cast< double >( heightInPixels ) / widthInPixels, markerLayer->defaultAspectRatio() ) )
markerLayer->setFixedAspectRatio( static_cast< double >( heightInPixels ) / widthInPixels );

markerLayer->setOffset( QPointF( xOffset, yOffset ) );
markerLayer->setOffsetUnit( QgsUnitTypes::RenderPoints );
@@ -225,7 +225,7 @@ void TestQgsArcGisRestUtils::testPictureMarkerSymbol()
QVERIFY( markerLayer );
QCOMPARE( markerLayer->path(), QStringLiteral( "base64:abcdef" ) );
QCOMPARE( markerLayer->size(), 20.0 );
QCOMPARE( markerLayer->fixedAspectRatio(), 0.8 );
QCOMPARE( markerLayer->fixedAspectRatio(), 1.25 );
QCOMPARE( markerLayer->sizeUnit(), QgsUnitTypes::RenderPixels );
QCOMPARE( markerLayer->angle(), -10.0 ); // opposite direction to esri spec!
QCOMPARE( markerLayer->offset(), QPointF( 7, 17 ) );

0 comments on commit 74172fc

Please sign in to comment.