Skip to content

Commit 222946b

Browse files
committedNov 21, 2013
Implement simple marker rect / square
1 parent de6f83e commit 222946b

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed
 

‎src/core/symbology-ng/qgsmarkersymbollayerv2.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,18 +709,37 @@ void QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
709709
size *= mmMapUnitScaleFactor;
710710
}
711711
double halfSize = size / 2.0;
712+
int colorIndex = QgsDxfExport::closestColorMatch( mBrush.color().rgb() );
712713

713714
if ( mName == "circle" )
714715
{
715716
e.writeGroup( 0, "CIRCLE" );
716-
e.writeGroup( 8, 0 );
717-
int colorIndex = QgsDxfExport::closestColorMatch( mBrush.color().rgb() );
717+
e.writeGroup( 8, "0" );
718+
718719
e.writeGroup( 62, colorIndex );
719720
e.writeGroup( 10, halfSize );
720721
e.writeGroup( 20, halfSize );
721722
e.writeGroup( 30, 0.0 );
722723
e.writeGroup( 40, halfSize );
723724
}
725+
else if ( mName == "square" || mName == "rectangle" )
726+
{
727+
e.writeGroup( 0, "SOLID" );
728+
e.writeGroup( 8, "0" );
729+
e.writeGroup( 62, colorIndex );
730+
e.writeGroup( 10, 0.0 );
731+
e.writeGroup( 20, 0.0 );
732+
e.writeGroup( 30, 0.0 );
733+
e.writeGroup( 11, size );
734+
e.writeGroup( 21, 0.0 );
735+
e.writeGroup( 31, 0.0 );
736+
e.writeGroup( 12, 0 );
737+
e.writeGroup( 22, size );
738+
e.writeGroup( 32, 0.0 );
739+
e.writeGroup( 13, size );
740+
e.writeGroup( 23, size );
741+
e.writeGroup( 33, 0.0 );
742+
}
724743
}
725744

726745
//////////

0 commit comments

Comments
 (0)
Please sign in to comment.