Make sure fill pattern conversion is hidpi friendly

This commit is contained in:
nirvn 2020-09-14 12:16:50 +07:00 committed by Nyall Dawson
parent 1de8d01e30
commit 4fe3d2f4e6

View File

@ -343,6 +343,8 @@ bool QgsMapBoxGlStyleConverter::parseFillLayer( const QVariantMap &jsonLayer, Qg
// when fill-pattern exists, set and insert QgsRasterFillSymbolLayer
QgsRasterFillSymbolLayer *rasterFill = new QgsRasterFillSymbolLayer();
rasterFill->setImageFilePath( sprite );
rasterFill->setWidth( spriteSize.width() );
rasterFill->setWidthUnit( context.targetUnit() );
rasterFill->setCoordinateMode( QgsRasterFillSymbolLayer::Viewport );
if ( rasterOpacity >= 0 )
@ -353,6 +355,7 @@ bool QgsMapBoxGlStyleConverter::parseFillLayer( const QVariantMap &jsonLayer, Qg
if ( !spriteProperty.isEmpty() )
{
ddRasterProperties.setProperty( QgsSymbolLayer::PropertyFile, QgsProperty::fromExpression( spriteProperty ) );
ddRasterProperties.setProperty( QgsSymbolLayer::PropertyWidth, QgsProperty::fromExpression( spriteSizeProperty ) );
}
rasterFill->setDataDefinedProperties( ddRasterProperties );