Skip to content

Commit 3fed0d0

Browse files
committed
Fix rotation for svg markers exported to dxf
1 parent ef3eee2 commit 3fed0d0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/core/dxf/qgsdxfexport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ void QgsDxfExport::writeBlocks()
490490
}
491491
writeGroup( 0, "BLOCK" );
492492
writeGroup( 8, 0 );
493-
QString blockName = QString( "symbolLayer%1" ).arg( mBlockCounter );
493+
QString blockName = QString( "symbolLayer%1" ).arg( mBlockCounter++ );
494494
writeGroup( 2, blockName );
495495
writeGroup( 70, 64 );
496496

src/core/symbology-ng/qgsmarkersymbollayerv2.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,9 +1285,14 @@ void QgsSvgMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScale
12851285

12861286
QPainter p;
12871287
p.begin( &pd );
1288-
p.rotate( angle );
1289-
pd.setShift( shift - QPointF( halfSize, halfSize ) );
1290-
pd.setOutputSize( QRectF( 0, 0, size, size ) );
1288+
if ( !qgsDoubleNear( angle, 0.0 ) )
1289+
{
1290+
p.translate( r.defaultSize().width() / 2.0, r.defaultSize().height() / 2.0 );
1291+
p.rotate( angle );
1292+
p.translate( -r.defaultSize().width() / 2.0, -r.defaultSize().height() / 2.0 );
1293+
}
1294+
pd.setShift( shift );
1295+
pd.setOutputSize( QRectF( -halfSize, -halfSize, size, size ) );
12911296
pd.setLayer( layerName );
12921297
r.render( &p );
12931298
p.end();

0 commit comments

Comments
 (0)