Skip to content

Commit ffded6f

Browse files
committedDec 10, 2018
[afs] Picture marker & picture fill width/height use points as unit type
1 parent 74172fc commit ffded6f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎src/providers/arcgisrest/qgsarcgisrestutils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ std::unique_ptr<QgsFillSymbol> QgsArcGisRestUtils::parseEsriPictureFillSymbolJso
658658
std::unique_ptr< QgsRasterFillSymbolLayer > fillLayer = qgis::make_unique< QgsRasterFillSymbolLayer >( symbolPath );
659659
fillLayer->setWidth( widthInPixels );
660660
fillLayer->setAngle( angleCW );
661-
fillLayer->setWidthUnit( QgsUnitTypes::RenderPixels );
661+
fillLayer->setWidthUnit( QgsUnitTypes::RenderPoints );
662662
fillLayer->setOffset( QPointF( xOffset, yOffset ) );
663663
fillLayer->setOffsetUnit( QgsUnitTypes::RenderPoints );
664664
layers.append( fillLayer.release() );
@@ -755,7 +755,7 @@ std::unique_ptr<QgsMarkerSymbol> QgsArcGisRestUtils::parseEsriPictureMarkerSymbo
755755

756756
QgsSymbolLayerList layers;
757757
std::unique_ptr< QgsRasterMarkerSymbolLayer > markerLayer = qgis::make_unique< QgsRasterMarkerSymbolLayer >( symbolPath, widthInPixels, angleCW, QgsSymbol::ScaleArea );
758-
markerLayer->setSizeUnit( QgsUnitTypes::RenderPixels );
758+
markerLayer->setSizeUnit( QgsUnitTypes::RenderPoints );
759759

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

‎tests/src/providers/testqgsarcgisrestutils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void TestQgsArcGisRestUtils::testPictureMarkerSymbol()
226226
QCOMPARE( markerLayer->path(), QStringLiteral( "base64:abcdef" ) );
227227
QCOMPARE( markerLayer->size(), 20.0 );
228228
QCOMPARE( markerLayer->fixedAspectRatio(), 1.25 );
229-
QCOMPARE( markerLayer->sizeUnit(), QgsUnitTypes::RenderPixels );
229+
QCOMPARE( markerLayer->sizeUnit(), QgsUnitTypes::RenderPoints );
230230
QCOMPARE( markerLayer->angle(), -10.0 ); // opposite direction to esri spec!
231231
QCOMPARE( markerLayer->offset(), QPointF( 7, 17 ) );
232232
QCOMPARE( markerLayer->offsetUnit(), QgsUnitTypes::RenderPoints );
@@ -333,7 +333,7 @@ void TestQgsArcGisRestUtils::testParsePictureFillSymbol()
333333
QVERIFY( fillLayer );
334334
QCOMPARE( fillLayer->imageFilePath(), QString( "base64:abcdef" ) );
335335
QCOMPARE( fillLayer->width(), 20.0 );
336-
QCOMPARE( fillLayer->widthUnit(), QgsUnitTypes::RenderPixels );
336+
QCOMPARE( fillLayer->widthUnit(), QgsUnitTypes::RenderPoints );
337337
QgsSimpleLineSymbolLayer *lineLayer = dynamic_cast< QgsSimpleLineSymbolLayer * >( fill->symbolLayer( 1 ) );
338338
QVERIFY( lineLayer );
339339
QCOMPARE( lineLayer->color(), QColor( 110, 120, 130, 215 ) );

0 commit comments

Comments
 (0)
Please sign in to comment.