Skip to content

Commit 71e09ec

Browse files
committed
Use new unit conversion function to calculate dxf line width
1 parent cc195a6 commit 71e09ec

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

src/core/dxf/qgsdxfexport.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,18 +1021,6 @@ void QgsDxfExport::addFeature( const QgsSymbolV2RenderContext& ctx, const QStrin
10211021
}
10221022
}
10231023

1024-
double QgsDxfExport::scaleToMapUnits( double value, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits ) const
1025-
{
1026-
if ( symbolUnits == QgsSymbolV2::MapUnit )
1027-
{
1028-
return 1.0;
1029-
}
1030-
1031-
//symbology in mm
1032-
value *= ( mSymbologyScaleDenominator * QGis::fromUnitToUnitFactor( mapUnits, QGis::Meters ) ) / 1000;
1033-
return value;
1034-
}
1035-
10361024
int QgsDxfExport::colorFromSymbolLayer( const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2RenderContext& ctx )
10371025
{
10381026
if ( !symbolLayer )
@@ -1111,14 +1099,8 @@ double QgsDxfExport::mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::O
11111099
{
11121100
return 1.0;
11131101
}
1114-
else if ( symbolUnits == QgsSymbolV2::MM && mapUnits == QGis::Meters )
1115-
{
1116-
return scaleDenominator / 1000;
1117-
}
1118-
else
1119-
{
1120-
return 1.0;
1121-
}
1102+
//MM symbol unit
1103+
return scaleDenominator * QGis::fromUnitToUnitFactor( QGis::Meters, mapUnits ) / 1000.0;
11221104
}
11231105

11241106
QList< QPair< QgsSymbolLayerV2*, QgsSymbolV2* > > QgsDxfExport::symbolLayers()

src/core/dxf/qgsdxfexport.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ class CORE_EXPORT QgsDxfExport
143143
QgsRectangle dxfExtent() const;
144144

145145
void addFeature( const QgsSymbolV2RenderContext& ctx, const QString& layer, const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2* symbol );
146-
double scaleToMapUnits( double value, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits ) const;
147146

148147
//returns dxf palette index from symbol layer color
149148
static int colorFromSymbolLayer( const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2RenderContext& ctx );

0 commit comments

Comments
 (0)