Skip to content

Commit

Permalink
Use new unit conversion function to calculate dxf line width
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jan 17, 2014
1 parent cc195a6 commit 71e09ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
22 changes: 2 additions & 20 deletions src/core/dxf/qgsdxfexport.cpp
Expand Up @@ -1021,18 +1021,6 @@ void QgsDxfExport::addFeature( const QgsSymbolV2RenderContext& ctx, const QStrin
}
}

double QgsDxfExport::scaleToMapUnits( double value, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits ) const
{
if ( symbolUnits == QgsSymbolV2::MapUnit )
{
return 1.0;
}

//symbology in mm
value *= ( mSymbologyScaleDenominator * QGis::fromUnitToUnitFactor( mapUnits, QGis::Meters ) ) / 1000;
return value;
}

int QgsDxfExport::colorFromSymbolLayer( const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2RenderContext& ctx )
{
if ( !symbolLayer )
Expand Down Expand Up @@ -1111,14 +1099,8 @@ double QgsDxfExport::mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::O
{
return 1.0;
}
else if ( symbolUnits == QgsSymbolV2::MM && mapUnits == QGis::Meters )
{
return scaleDenominator / 1000;
}
else
{
return 1.0;
}
//MM symbol unit
return scaleDenominator * QGis::fromUnitToUnitFactor( QGis::Meters, mapUnits ) / 1000.0;
}

QList< QPair< QgsSymbolLayerV2*, QgsSymbolV2* > > QgsDxfExport::symbolLayers()
Expand Down
1 change: 0 additions & 1 deletion src/core/dxf/qgsdxfexport.h
Expand Up @@ -143,7 +143,6 @@ class CORE_EXPORT QgsDxfExport
QgsRectangle dxfExtent() const;

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

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

0 comments on commit 71e09ec

Please sign in to comment.