Skip to content
Permalink
Browse files

Support more QgsMapUnitScale properties in dxf export

  • Loading branch information
mhugent committed Apr 12, 2018
1 parent 505822f commit b73ac0f1f8416f500ce9743acbe31286f54d556f
@@ -622,12 +622,13 @@ double QgsSimpleLineSymbolLayerV2::dxfWidth( const QgsDxfExport& e, QgsSymbolV2R
context.setOriginalValueVariable( mWidth );
width = evaluateDataDefinedProperty( QgsSymbolLayerV2::EXPR_WIDTH, context, mWidth ).toDouble();
}
else if ( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale )

width *= e.mapUnitScaleFactor( e.symbologyScaleDenominator(), widthUnit(), e.mapUnits(), context.renderContext().mapToPixel().mapUnitsPerPixel() );
if ( mWidthUnit == QgsSymbolV2::MapUnit )
{
width = QgsSymbolLayerV2Utils::convertToPainterUnits( context.renderContext(), mWidth, mWidthUnit, mWidthMapUnitScale );
e.clipValueToMapUnitScale( width, mWidthMapUnitScale, context.renderContext().scaleFactor() );
}

return width * e.mapUnitScaleFactor( e.symbologyScaleDenominator(), widthUnit(), e.mapUnits(), context.renderContext().mapToPixel().mapUnitsPerPixel() );
return width;
}

QColor QgsSimpleLineSymbolLayerV2::dxfColor( QgsSymbolV2RenderContext& context ) const
@@ -1316,6 +1316,10 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
outlineWidth = evaluateDataDefinedProperty( QgsSymbolLayerV2::EXPR_OUTLINE_WIDTH, context, mOutlineWidth ).toDouble();
}
outlineWidth *= e.mapUnitScaleFactor( e.symbologyScaleDenominator(), mOutlineWidthUnit, e.mapUnits(), context.renderContext().mapToPixel().mapUnitsPerPixel() );
if ( mOutlineWidthUnit == QgsSymbolV2::MapUnit )
{
e.clipValueToMapUnitScale( outlineWidth, mOutlineWidthMapUnitScale, context.renderContext().scaleFactor() );
}

//color
QColor pc = mPen.color();

0 comments on commit b73ac0f

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