@@ -352,11 +352,13 @@ void QgsSimpleFillSymbolLayerV2::toSld( QDomDocument &doc, QDomElement &element,
352352 // <Stroke>
353353 QDomElement strokeElem = doc.createElement ( " se:Stroke" );
354354 symbolizerElem.appendChild ( strokeElem );
355- QgsSymbolLayerV2Utils::lineToSld ( doc, strokeElem, mBorderStyle , mBorderColor , mBorderWidth , &mPenJoinStyle );
355+ double borderWidth = QgsSymbolLayerV2Utils::rescaleUom ( mBorderWidth , mBorderWidthUnit , props );
356+ QgsSymbolLayerV2Utils::lineToSld ( doc, strokeElem, mBorderStyle , borderWidth, borderWidth, &mPenJoinStyle );
356357 }
357358
358359 // <se:Displacement>
359- QgsSymbolLayerV2Utils::createDisplacementElement ( doc, symbolizerElem, mOffset );
360+ QPointF offset = QgsSymbolLayerV2Utils::rescaleUom ( mOffset , mOffsetUnit , props );
361+ QgsSymbolLayerV2Utils::createDisplacementElement ( doc, symbolizerElem, offset );
360362}
361363
362364QString QgsSimpleFillSymbolLayerV2::ogrFeatureStyle ( double mmScaleFactor, double mapUnitScaleFactor ) const
@@ -1778,6 +1780,7 @@ void QgsSVGFillSymbolLayer::setOutputUnit( QgsSymbolV2::OutputUnit unit )
17781780 mPatternWidthUnit = unit;
17791781 mSvgOutlineWidthUnit = unit;
17801782 mOutlineWidthUnit = unit;
1783+ mOutline ->setOutputUnit ( unit );
17811784}
17821785
17831786QgsSymbolV2::OutputUnit QgsSVGFillSymbolLayer::outputUnit () const
@@ -2088,7 +2091,8 @@ void QgsSVGFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, cons
20882091
20892092 if ( !mSvgFilePath .isEmpty () )
20902093 {
2091- QgsSymbolLayerV2Utils::externalGraphicToSld ( doc, graphicElem, mSvgFilePath , " image/svg+xml" , mColor , mPatternWidth );
2094+ double partternWidth = QgsSymbolLayerV2Utils::rescaleUom ( mPatternWidth , mPatternWidthUnit , props );
2095+ QgsSymbolLayerV2Utils::externalGraphicToSld ( doc, graphicElem, mSvgFilePath , " image/svg+xml" , mColor , partternWidth );
20922096 }
20932097 else
20942098 {
@@ -2099,7 +2103,8 @@ void QgsSVGFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, cons
20992103
21002104 if ( mSvgOutlineColor .isValid () || mSvgOutlineWidth >= 0 )
21012105 {
2102- QgsSymbolLayerV2Utils::lineToSld ( doc, graphicElem, Qt::SolidLine, mSvgOutlineColor , mSvgOutlineWidth );
2106+ double svgOutlineWidth = QgsSymbolLayerV2Utils::rescaleUom ( mSvgOutlineWidth , mSvgOutlineWidthUnit , props );
2107+ QgsSymbolLayerV2Utils::lineToSld ( doc, graphicElem, Qt::SolidLine, mSvgOutlineColor , svgOutlineWidth );
21032108 }
21042109
21052110 // <Rotation>
@@ -2887,7 +2892,9 @@ void QgsLinePatternFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &eleme
28872892 // line properties must be inside the graphic definition
28882893 QColor lineColor = mFillLineSymbol ? mFillLineSymbol ->color () : QColor ();
28892894 double lineWidth = mFillLineSymbol ? mFillLineSymbol ->width () : 0.0 ;
2890- QgsSymbolLayerV2Utils::wellKnownMarkerToSld ( doc, graphicElem, " horline" , QColor (), lineColor, Qt::SolidLine, lineWidth, mDistance );
2895+ lineWidth = QgsSymbolLayerV2Utils::rescaleUom ( lineWidth, mLineWidthUnit , props );
2896+ double distance = QgsSymbolLayerV2Utils::rescaleUom ( mDistance , mDistanceUnit , props );
2897+ QgsSymbolLayerV2Utils::wellKnownMarkerToSld ( doc, graphicElem, " horline" , QColor (), lineColor, Qt::SolidLine, lineWidth, distance );
28912898
28922899 // <Rotation>
28932900 QString angleFunc;
@@ -2905,6 +2912,7 @@ void QgsLinePatternFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &eleme
29052912
29062913 // <se:Displacement>
29072914 QPointF lineOffset ( sin ( mLineAngle ) * mOffset , cos ( mLineAngle ) * mOffset );
2915+ lineOffset = QgsSymbolLayerV2Utils::rescaleUom ( lineOffset, mOffsetUnit , props );
29082916 QgsSymbolLayerV2Utils::createDisplacementElement ( doc, graphicElem, lineOffset );
29092917}
29102918
@@ -3064,6 +3072,11 @@ void QgsPointPatternFillSymbolLayer::setOutputUnit( QgsSymbolV2::OutputUnit unit
30643072 mDistanceYUnit = unit;
30653073 mDisplacementXUnit = unit;
30663074 mDisplacementYUnit = unit;
3075+ if ( mMarkerSymbol )
3076+ {
3077+ mMarkerSymbol ->setOutputUnit ( unit );
3078+ }
3079+
30673080}
30683081
30693082QgsSymbolV2::OutputUnit QgsPointPatternFillSymbolLayer::outputUnit () const
@@ -3306,7 +3319,9 @@ void QgsPointPatternFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &elem
33063319 fillElem.appendChild ( graphicFillElem );
33073320
33083321 // store distanceX, distanceY, displacementX, displacementY in a <VendorOption>
3309- QString dist = QgsSymbolLayerV2Utils::encodePoint ( QPointF ( mDistanceX , mDistanceY ) );
3322+ double dx = QgsSymbolLayerV2Utils::rescaleUom ( mDistanceX , mDistanceXUnit , props );
3323+ double dy = QgsSymbolLayerV2Utils::rescaleUom ( mDistanceY , mDistanceYUnit , props );
3324+ QString dist = QgsSymbolLayerV2Utils::encodePoint ( QPointF ( dx, dy ) );
33103325 QDomElement distanceElem = QgsSymbolLayerV2Utils::createVendorOptionElement ( doc, " distance" , dist );
33113326 symbolizerElem.appendChild ( distanceElem );
33123327
0 commit comments