Skip to content

Commit

Permalink
Implement simple marker rect / square
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Nov 21, 2013
1 parent de6f83e commit 222946b
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Expand Up @@ -709,18 +709,37 @@ void QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
size *= mmMapUnitScaleFactor;
}
double halfSize = size / 2.0;
int colorIndex = QgsDxfExport::closestColorMatch( mBrush.color().rgb() );

if ( mName == "circle" )
{
e.writeGroup( 0, "CIRCLE" );
e.writeGroup( 8, 0 );
int colorIndex = QgsDxfExport::closestColorMatch( mBrush.color().rgb() );
e.writeGroup( 8, "0" );

e.writeGroup( 62, colorIndex );
e.writeGroup( 10, halfSize );
e.writeGroup( 20, halfSize );
e.writeGroup( 30, 0.0 );
e.writeGroup( 40, halfSize );
}
else if ( mName == "square" || mName == "rectangle" )
{
e.writeGroup( 0, "SOLID" );
e.writeGroup( 8, "0" );
e.writeGroup( 62, colorIndex );
e.writeGroup( 10, 0.0 );
e.writeGroup( 20, 0.0 );
e.writeGroup( 30, 0.0 );
e.writeGroup( 11, size );
e.writeGroup( 21, 0.0 );
e.writeGroup( 31, 0.0 );
e.writeGroup( 12, 0 );
e.writeGroup( 22, size );
e.writeGroup( 32, 0.0 );
e.writeGroup( 13, size );
e.writeGroup( 23, size );
e.writeGroup( 33, 0.0 );
}
}

//////////
Expand Down

0 comments on commit 222946b

Please sign in to comment.