mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-19 00:04:52 -04:00
[svg markers] allow setting alpha value for fill and outline colors
This commit is contained in:
parent
ee720796a3
commit
757cd7af85
@ -620,14 +620,22 @@ void QgsSvgCache::replaceElemParams( QDomElement& elem, const QColor& fill, cons
|
||||
}
|
||||
QString key = keyValueSplit.at( 0 );
|
||||
QString value = keyValueSplit.at( 1 );
|
||||
if ( value.startsWith( "param(fill" ) )
|
||||
if ( value.startsWith( "param(fill)" ) )
|
||||
{
|
||||
value = fill.name();
|
||||
}
|
||||
else if ( value.startsWith( "param(fill-opacity)" ) )
|
||||
{
|
||||
value = fill.alphaF();
|
||||
}
|
||||
else if ( value.startsWith( "param(outline)" ) )
|
||||
{
|
||||
value = outline.name();
|
||||
}
|
||||
else if ( value.startsWith( "param(outline-opacity)" ) )
|
||||
{
|
||||
value = outline.alphaF();
|
||||
}
|
||||
else if ( value.startsWith( "param(outline-width)" ) )
|
||||
{
|
||||
value = QString::number( outlineWidth );
|
||||
@ -648,10 +656,18 @@ void QgsSvgCache::replaceElemParams( QDomElement& elem, const QColor& fill, cons
|
||||
{
|
||||
elem.setAttribute( attribute.name(), fill.name() );
|
||||
}
|
||||
else if ( value.startsWith( "param(fill-opacity)" ) )
|
||||
{
|
||||
elem.setAttribute( attribute.name(), fill.alphaF() );
|
||||
}
|
||||
else if ( value.startsWith( "param(outline)" ) )
|
||||
{
|
||||
elem.setAttribute( attribute.name(), outline.name() );
|
||||
}
|
||||
else if ( value.startsWith( "param(outline-opacity)" ) )
|
||||
{
|
||||
elem.setAttribute( attribute.name(), outline.alphaF() );
|
||||
}
|
||||
else if ( value.startsWith( "param(outline-width)" ) )
|
||||
{
|
||||
elem.setAttribute( attribute.name(), QString::number( outlineWidth ) );
|
||||
|
@ -1564,11 +1564,12 @@ QgsSvgMarkerSymbolLayerV2Widget::QgsSvgMarkerSymbolLayerV2Widget( const QgsVecto
|
||||
mBorderWidthUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit << QgsSymbolV2::Pixel );
|
||||
mOffsetUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit << QgsSymbolV2::Pixel );
|
||||
viewGroups->setHeaderHidden( true );
|
||||
|
||||
mChangeColorButton->setAllowAlpha( true );
|
||||
mChangeColorButton->setColorDialogTitle( tr( "Select fill color" ) );
|
||||
mChangeColorButton->setContext( "symbology" );
|
||||
mChangeBorderColorButton->setAllowAlpha( true );
|
||||
mChangeBorderColorButton->setColorDialogTitle( tr( "Select border color" ) );
|
||||
mChangeColorButton->setContext( "symbology" );
|
||||
mChangeBorderColorButton->setContext( "symbology" );
|
||||
|
||||
spinOffsetX->setClearValue( 0.0 );
|
||||
spinOffsetY->setClearValue( 0.0 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user