Skip to content
Permalink
Browse files

Fix dxf export when CRS is not canvas CRS and not limiting to canvas …

…extent
  • Loading branch information
nyalldawson committed Oct 4, 2017
1 parent 83fdc5d commit 0b47ea8011e85d9c36749fe654867462d6e36ee1
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/dxf/qgsdxfexport.cpp
@@ -499,6 +499,9 @@ int QgsDxfExport::writeToFile( QIODevice *d, const QString &encoding )
mTextStream.setDevice( d );
mTextStream.setCodec( encoding.toLocal8Bit() );

if ( mCrs.isValid() )
mMapSettings.setDestinationCrs( mCrs );

if ( mExtent.isEmpty() )
{
const QList< QgsMapLayer * > layers = mMapSettings.layers();
@@ -529,8 +532,6 @@ int QgsDxfExport::writeToFile( QIODevice *d, const QString &encoding )
mFactor = 1000 * dpi / mSymbologyScale / 25.4 * QgsUnitTypes::fromUnitToUnitFactor( mapUnits, QgsUnitTypes::DistanceMeters );
mMapSettings.setOutputSize( QSize( mExtent.width() * mFactor, mExtent.height() * mFactor ) );
mMapSettings.setOutputDpi( dpi );
if ( mCrs.isValid() )
mMapSettings.setDestinationCrs( mCrs );

writeHeader( dxfEncoding( encoding ) );
writeTables();

0 comments on commit 0b47ea8

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