Skip to content
Permalink
Browse files

[afs] Picture marker & picture fill width/height use points as unit type

  • Loading branch information
nirvn committed Dec 10, 2018
1 parent 74172fc commit ffded6f1d8700007208e10db807e70d60711a11c
@@ -658,7 +658,7 @@ std::unique_ptr<QgsFillSymbol> QgsArcGisRestUtils::parseEsriPictureFillSymbolJso
std::unique_ptr< QgsRasterFillSymbolLayer > fillLayer = qgis::make_unique< QgsRasterFillSymbolLayer >( symbolPath );
fillLayer->setWidth( widthInPixels );
fillLayer->setAngle( angleCW );
fillLayer->setWidthUnit( QgsUnitTypes::RenderPixels );
fillLayer->setWidthUnit( QgsUnitTypes::RenderPoints );
fillLayer->setOffset( QPointF( xOffset, yOffset ) );
fillLayer->setOffsetUnit( QgsUnitTypes::RenderPoints );
layers.append( fillLayer.release() );
@@ -755,7 +755,7 @@ 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->setSizeUnit( QgsUnitTypes::RenderPoints );

// only change the default aspect ratio if the server height setting requires this
if ( !qgsDoubleNear( static_cast< double >( heightInPixels ) / widthInPixels, markerLayer->defaultAspectRatio() ) )
@@ -226,7 +226,7 @@ void TestQgsArcGisRestUtils::testPictureMarkerSymbol()
QCOMPARE( markerLayer->path(), QStringLiteral( "base64:abcdef" ) );
QCOMPARE( markerLayer->size(), 20.0 );
QCOMPARE( markerLayer->fixedAspectRatio(), 1.25 );
QCOMPARE( markerLayer->sizeUnit(), QgsUnitTypes::RenderPixels );
QCOMPARE( markerLayer->sizeUnit(), QgsUnitTypes::RenderPoints );
QCOMPARE( markerLayer->angle(), -10.0 ); // opposite direction to esri spec!
QCOMPARE( markerLayer->offset(), QPointF( 7, 17 ) );
QCOMPARE( markerLayer->offsetUnit(), QgsUnitTypes::RenderPoints );
@@ -333,7 +333,7 @@ void TestQgsArcGisRestUtils::testParsePictureFillSymbol()
QVERIFY( fillLayer );
QCOMPARE( fillLayer->imageFilePath(), QString( "base64:abcdef" ) );
QCOMPARE( fillLayer->width(), 20.0 );
QCOMPARE( fillLayer->widthUnit(), QgsUnitTypes::RenderPixels );
QCOMPARE( fillLayer->widthUnit(), QgsUnitTypes::RenderPoints );
QgsSimpleLineSymbolLayer *lineLayer = dynamic_cast< QgsSimpleLineSymbolLayer * >( fill->symbolLayer( 1 ) );
QVERIFY( lineLayer );
QCOMPARE( lineLayer->color(), QColor( 110, 120, 130, 215 ) );

0 comments on commit ffded6f

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