Skip to content
Permalink
Browse files

Set text color and show label boxes for debugging

  • Loading branch information
mhugent committed Jan 17, 2014
1 parent a7a942c commit 82acf7696e16676b6c3d3fb6f892d7a1271871c2
Showing with 12 additions and 4 deletions.
  1. +2 −2 src/core/dxf/qgsdxfexport.cpp
  2. +1 −1 src/core/dxf/qgsdxfexport.h
  3. +9 −1 src/core/dxf/qgsdxfpallabeling.cpp
@@ -871,11 +871,11 @@ void QgsDxfExport::writeCircle( const QString& layer, int color, const QgsPoint&
writeGroup( 40, radius );
}

void QgsDxfExport::writeText( const QString& layer, const QString& text, const QgsPoint& pt, double size, double angle )
void QgsDxfExport::writeText( const QString& layer, const QString& text, const QgsPoint& pt, double size, double angle, int color )
{
writeGroup( 0, "TEXT" );
writeGroup( 8, layer );
//todo: color with code 64
writeGroup( 62, color );
writeGroup( 10, pt.x() );
writeGroup( 20, pt.y() );
writeGroup( 30, 0 );
@@ -83,7 +83,7 @@ class CORE_EXPORT QgsDxfExport

void writeCircle( const QString& layer, int color, const QgsPoint& pt, double radius );

void writeText( const QString& layer, const QString& text, const QgsPoint& pt, double size, double angle );
void writeText( const QString& layer, const QString& text, const QgsPoint& pt, double size, double angle, int color );

static double mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits );

@@ -70,6 +70,14 @@ void QgsDxfPalLabeling::drawLabel( pal::LabelPosition* label, QgsRenderContext&
//angle
double angle = label->getAlpha() * 180 / M_PI;

mDxfExport->writeText( layerName, text, QgsPoint( label->getX(), label->getY() ), label->getHeight(), angle );
//debug: show label rectangle
/*QgsPolyline line;
for( int i = 0; i < 4; ++i )
{
line.append( QgsPoint( label->getX( i ), label->getY( i ) ) );
}
mDxfExport->writePolyline( line, layerName, "CONTINUOUS", 0, 1, true );*/

mDxfExport->writeText( layerName, text, QgsPoint( label->getX(), label->getY() ), label->getHeight(), angle, mDxfExport->closestColorMatch( tmpLyr.textColor.rgb() ) );
}
}

0 comments on commit 82acf76

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