Skip to content

Commit 409a59f

Browse files
committed
Use the line digitizing settings for the note tool rubber band
1 parent c465705 commit 409a59f

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/app/nodetool/qgsmaptoolnodetool.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,16 @@ void QgsMapToolNodeTool::createTopologyRubberBands()
8585
if ( !mMoveRubberBands.contains( snapFeatureId ) )
8686
{
8787
QgsGeometryRubberBand* rb = new QgsGeometryRubberBand( mCanvas, feature.geometry()->type() );
88-
rb->setOutlineColor( Qt::blue );
88+
QSettings settings;
89+
QColor color(
90+
settings.value( "/qgis/digitizing/line_color_red", 255 ).toInt(),
91+
settings.value( "/qgis/digitizing/line_color_green", 0 ).toInt(),
92+
settings.value( "/qgis/digitizing/line_color_blue", 0 ).toInt() );
93+
double myAlpha = settings.value( "/qgis/digitizing/line_color_alpha", 30 ).toInt() / 255.0 ;
94+
color.setAlphaF( myAlpha );
95+
rb->setOutlineColor( color );
8996
rb->setBrushStyle( Qt::NoBrush );
90-
rb->setOutlineWidth( 2 );
97+
rb->setOutlineWidth( settings.value( "/qgis/digitizing/line_width", 1 ).toInt() );
9198
QgsAbstractGeometryV2* rbGeom = feature.geometry()->geometry()->clone();
9299
if ( mCanvas->mapSettings().layerTransform( vlayer ) )
93100
rbGeom->transform( *mCanvas->mapSettings().layerTransform( vlayer ) );
@@ -115,9 +122,16 @@ void QgsMapToolNodeTool::canvasMoveEvent( QgsMapMouseEvent* e )
115122
if ( mMoveRubberBands.empty() )
116123
{
117124
QgsGeometryRubberBand* rb = new QgsGeometryRubberBand( mCanvas, mSelectedFeature->geometry()->type() );
118-
rb->setOutlineColor( Qt::blue );
125+
QSettings settings;
126+
QColor color(
127+
settings.value( "/qgis/digitizing/line_color_red", 255 ).toInt(),
128+
settings.value( "/qgis/digitizing/line_color_green", 0 ).toInt(),
129+
settings.value( "/qgis/digitizing/line_color_blue", 0 ).toInt() );
130+
double myAlpha = settings.value( "/qgis/digitizing/line_color_alpha", 30 ).toInt() / 255.0 ;
131+
color.setAlphaF( myAlpha );
132+
rb->setOutlineColor( color );
119133
rb->setBrushStyle( Qt::NoBrush );
120-
rb->setOutlineWidth( 2 );
134+
rb->setOutlineWidth( settings.value( "/qgis/digitizing/line_width", 1 ).toInt() );
121135
QgsAbstractGeometryV2* rbGeom = mSelectedFeature->geometry()->geometry()->clone();
122136
if ( mCanvas->mapSettings().layerTransform( vlayer ) )
123137
rbGeom->transform( *mCanvas->mapSettings().layerTransform( vlayer ) );

0 commit comments

Comments
 (0)