Skip to content

Commit 996de71

Browse files
committed
Merge pull request #2608 from sbrunner/fill-select
Fix fill and select mixage
2 parents a32587b + 409a59f commit 996de71

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

src/app/nodetool/qgsmaptoolnodetool.cpp

+22-8
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 ) );
@@ -363,10 +377,10 @@ void QgsMapToolNodeTool::updateSelectFeature()
363377

364378
QSettings settings;
365379
QColor color(
366-
settings.value( "/qgis/digitizing/select_color_red", 255 ).toInt(),
367-
settings.value( "/qgis/digitizing/select_color_green", 0 ).toInt(),
368-
settings.value( "/qgis/digitizing/select_color_blue", 0 ).toInt() );
369-
double myAlpha = settings.value( "/qgis/digitizing/select_color_alpha", 30 ).toInt() / 255.0 ;
380+
settings.value( "/qgis/digitizing/fill_color_red", 255 ).toInt(),
381+
settings.value( "/qgis/digitizing/fill_color_green", 0 ).toInt(),
382+
settings.value( "/qgis/digitizing/fill_color_blue", 0 ).toInt() );
383+
double myAlpha = settings.value( "/qgis/digitizing/fill_color_alpha", 30 ).toInt() / 255.0 ;
370384
color.setAlphaF( myAlpha );
371385
mSelectRubberBand->setFillColor( color );
372386

0 commit comments

Comments
 (0)