Skip to content

Commit 5d59d83

Browse files
committed
#9060: use QGis::fromUnitToUnitFactor in QgsDxfExport
in
1 parent b662d1b commit 5d59d83

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/core/dxf/qgsdxfexport.cpp

+2-18
Original file line numberDiff line numberDiff line change
@@ -962,15 +962,7 @@ double QgsDxfExport::scaleToMapUnits( double value, QgsSymbolV2::OutputUnit symb
962962
}
963963

964964
//symbology in mm
965-
value *= mSymbologyScaleDenominator / 1000;
966-
if ( mapUnits == QGis::Feet )
967-
{
968-
value *= 0.3048;
969-
}
970-
else if ( mapUnits == QGis::Degrees )
971-
{
972-
value /= 111120;
973-
}
965+
value *= ( mSymbologyScaleDenominator * QGis::fromUnitToUnitFactor( mapUnits, QGis::Meters ) ) / 1000;
974966
return value;
975967
}
976968

@@ -1279,15 +1271,7 @@ double QgsDxfExport::dashSeparatorSize() const
12791271

12801272
double QgsDxfExport::sizeToMapUnits( double s ) const
12811273
{
1282-
double size = s;
1283-
if ( mMapUnits == QGis::Feet )
1284-
{
1285-
size /= 0.3048;
1286-
}
1287-
else if ( mMapUnits == QGis::Degrees )
1288-
{
1289-
size /= 111120;
1290-
}
1274+
double size = s * QGis::fromUnitToUnitFactor( QGis::Meters, mMapUnits );
12911275
return size;
12921276
}
12931277

0 commit comments

Comments
 (0)