Skip to content

Commit 9d23c6f

Browse files
committedAug 28, 2016
dxf export: link vertices to polyline (fixes #15484)
(cherry picked from commit 052d3ef)
1 parent c5aa2e1 commit 9d23c6f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed
 

‎src/core/dxf/qgsdxfexport.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,12 @@ void QgsDxfExport::writeGroup( const QColor& color, int exactMatchCode, int rgbC
449449
minDist = dist;
450450
}
451451

452-
if ( minDist == 0 && color.alpha() == 255 && minDistAt != 7 )
452+
if ( minDist == 0 && minDistAt != 7 )
453453
{
454454
// exact full opaque match, not black/white
455455
writeGroup( exactMatchCode, minDistAt );
456-
return;
456+
if ( color.alpha() == 255 )
457+
return;
457458
}
458459

459460
int c = ( color.red() & 0xff ) * 0x10000 + ( color.green() & 0xff ) * 0x100 + ( color.blue() & 0xff );
@@ -3435,21 +3436,24 @@ void QgsDxfExport::writePolyline( const QgsPointSequenceV2 &line, const QString&
34353436
else
34363437
{
34373438
writeGroup( 0, "POLYLINE" );
3438-
writeHandle();
3439-
writeGroup( 8, layer );
3439+
int plHandle = writeHandle();
3440+
writeGroup( 330, mBlockHandle );
34403441
writeGroup( 100, "AcDbEntity" );
3441-
writeGroup( 100, "AcDb3dPolyline" );
3442+
writeGroup( 8, layer );
34423443
writeGroup( 6, lineStyleName );
3443-
writeGroup( 0, QgsPointV2( QgsWKBTypes::PointZ ) );
34443444
writeGroup( color );
3445+
writeGroup( 100, "AcDb3dPolyline" );
3446+
writeGroup( 0, QgsPointV2( QgsWKBTypes::PointZ ) );
34453447
writeGroup( 70, 8 );
34463448

34473449
for ( int i = 0; i < n; i++ )
34483450
{
34493451
writeGroup( 0, "VERTEX" );
34503452
writeHandle();
3451-
writeGroup( 8, layer );
3453+
writeGroup( 330, plHandle );
34523454
writeGroup( 100, "AcDbEntity" );
3455+
writeGroup( 8, layer );
3456+
writeGroup( color );
34533457
writeGroup( 100, "AcDbVertex" );
34543458
writeGroup( 100, "AcDb3dPolylineVertex" );
34553459
writeGroup( 0, line[i] );
@@ -3458,8 +3462,10 @@ void QgsDxfExport::writePolyline( const QgsPointSequenceV2 &line, const QString&
34583462

34593463
writeGroup( 0, "SEQEND" );
34603464
writeHandle();
3461-
writeGroup( 8, layer );
3465+
writeGroup( 330, plHandle );
34623466
writeGroup( 100, "AcDbEntity" );
3467+
writeGroup( 8, layer );
3468+
writeGroup( color );
34633469
}
34643470
}
34653471

0 commit comments

Comments
 (0)
Please sign in to comment.