Skip to content
Permalink
Browse files

Fix rotation for svg markers exported to dxf

  • Loading branch information
mhugent committed Dec 5, 2013
1 parent ef3eee2 commit 3fed0d0755a518395d136b6a608e89cda557de2d
Showing with 9 additions and 4 deletions.
  1. +1 −1 src/core/dxf/qgsdxfexport.cpp
  2. +8 −3 src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
@@ -490,7 +490,7 @@ void QgsDxfExport::writeBlocks()
}
writeGroup( 0, "BLOCK" );
writeGroup( 8, 0 );
QString blockName = QString( "symbolLayer%1" ).arg( mBlockCounter );
QString blockName = QString( "symbolLayer%1" ).arg( mBlockCounter++ );
writeGroup( 2, blockName );
writeGroup( 70, 64 );

@@ -1285,9 +1285,14 @@ void QgsSvgMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScale

QPainter p;
p.begin( &pd );
p.rotate( angle );
pd.setShift( shift - QPointF( halfSize, halfSize ) );
pd.setOutputSize( QRectF( 0, 0, size, size ) );
if ( !qgsDoubleNear( angle, 0.0 ) )
{
p.translate( r.defaultSize().width() / 2.0, r.defaultSize().height() / 2.0 );
p.rotate( angle );
p.translate( -r.defaultSize().width() / 2.0, -r.defaultSize().height() / 2.0 );
}
pd.setShift( shift );
pd.setOutputSize( QRectF( -halfSize, -halfSize, size, size ) );
pd.setLayer( layerName );
r.render( &p );
p.end();

0 comments on commit 3fed0d0

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