Skip to content
Permalink
Browse files

Handle correctly the unit type millimeter when exporting simple marke…

…r symbol to DXF.

The strategy is the same as the one used when exporting svg marker symbol, ie simply use the map unit scale factor to scale the marker.

Should fix #28854.
  • Loading branch information
obrix authored and nyalldawson committed Feb 6, 2020
1 parent 927d10c commit 855789742f5999806a731fa68f36eb1980c18c04
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/core/symbology/qgsmarkersymbollayer.cpp
@@ -1233,8 +1233,6 @@ void QgsSimpleMarkerSymbolLayer::drawMarker( QPainter *p, QgsSymbolRenderContext

bool QgsSimpleMarkerSymbolLayer::writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift ) const
{
Q_UNUSED( mmMapUnitScaleFactor )

//data defined size?
double size = mSize;

@@ -1260,6 +1258,12 @@ bool QgsSimpleMarkerSymbolLayer::writeDxf( QgsDxfExport &e, double mmMapUnitScal

size *= e.mapUnitScaleFactor( e.symbologyScale(), mSizeUnit, e.mapUnits(), context.renderContext().mapToPixel().mapUnitsPerPixel() );
}

if ( mSizeUnit == QgsUnitTypes::RenderMillimeters )
{
size *= mmMapUnitScaleFactor;
}

if ( mSizeUnit == QgsUnitTypes::RenderMapUnits )
{
e.clipValueToMapUnitScale( size, mSizeMapUnitScale, context.renderContext().scaleFactor() );

0 comments on commit 8557897

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