Skip to content

Commit

Permalink
Use the line digitizing settings for the note tool rubber band
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Dec 23, 2015
1 parent c465705 commit 409a59f
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/app/nodetool/qgsmaptoolnodetool.cpp
Expand Up @@ -85,9 +85,16 @@ void QgsMapToolNodeTool::createTopologyRubberBands()
if ( !mMoveRubberBands.contains( snapFeatureId ) )
{
QgsGeometryRubberBand* rb = new QgsGeometryRubberBand( mCanvas, feature.geometry()->type() );
rb->setOutlineColor( Qt::blue );
QSettings settings;
QColor color(
settings.value( "/qgis/digitizing/line_color_red", 255 ).toInt(),
settings.value( "/qgis/digitizing/line_color_green", 0 ).toInt(),
settings.value( "/qgis/digitizing/line_color_blue", 0 ).toInt() );
double myAlpha = settings.value( "/qgis/digitizing/line_color_alpha", 30 ).toInt() / 255.0 ;
color.setAlphaF( myAlpha );
rb->setOutlineColor( color );
rb->setBrushStyle( Qt::NoBrush );
rb->setOutlineWidth( 2 );
rb->setOutlineWidth( settings.value( "/qgis/digitizing/line_width", 1 ).toInt() );
QgsAbstractGeometryV2* rbGeom = feature.geometry()->geometry()->clone();
if ( mCanvas->mapSettings().layerTransform( vlayer ) )
rbGeom->transform( *mCanvas->mapSettings().layerTransform( vlayer ) );
Expand Down Expand Up @@ -115,9 +122,16 @@ void QgsMapToolNodeTool::canvasMoveEvent( QgsMapMouseEvent* e )
if ( mMoveRubberBands.empty() )
{
QgsGeometryRubberBand* rb = new QgsGeometryRubberBand( mCanvas, mSelectedFeature->geometry()->type() );
rb->setOutlineColor( Qt::blue );
QSettings settings;
QColor color(
settings.value( "/qgis/digitizing/line_color_red", 255 ).toInt(),
settings.value( "/qgis/digitizing/line_color_green", 0 ).toInt(),
settings.value( "/qgis/digitizing/line_color_blue", 0 ).toInt() );
double myAlpha = settings.value( "/qgis/digitizing/line_color_alpha", 30 ).toInt() / 255.0 ;
color.setAlphaF( myAlpha );
rb->setOutlineColor( color );
rb->setBrushStyle( Qt::NoBrush );
rb->setOutlineWidth( 2 );
rb->setOutlineWidth( settings.value( "/qgis/digitizing/line_width", 1 ).toInt() );
QgsAbstractGeometryV2* rbGeom = mSelectedFeature->geometry()->geometry()->clone();
if ( mCanvas->mapSettings().layerTransform( vlayer ) )
rbGeom->transform( *mCanvas->mapSettings().layerTransform( vlayer ) );
Expand Down

0 comments on commit 409a59f

Please sign in to comment.