Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2608 from sbrunner/fill-select
Fix fill and select mixage
  • Loading branch information
m-kuhn committed Dec 23, 2015
2 parents a32587b + 409a59f commit 996de71
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 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 Expand Up @@ -363,10 +377,10 @@ void QgsMapToolNodeTool::updateSelectFeature()

QSettings settings;
QColor color(
settings.value( "/qgis/digitizing/select_color_red", 255 ).toInt(),
settings.value( "/qgis/digitizing/select_color_green", 0 ).toInt(),
settings.value( "/qgis/digitizing/select_color_blue", 0 ).toInt() );
double myAlpha = settings.value( "/qgis/digitizing/select_color_alpha", 30 ).toInt() / 255.0 ;
settings.value( "/qgis/digitizing/fill_color_red", 255 ).toInt(),
settings.value( "/qgis/digitizing/fill_color_green", 0 ).toInt(),
settings.value( "/qgis/digitizing/fill_color_blue", 0 ).toInt() );
double myAlpha = settings.value( "/qgis/digitizing/fill_color_alpha", 30 ).toInt() / 255.0 ;
color.setAlphaF( myAlpha );
mSelectRubberBand->setFillColor( color );

Expand Down

0 comments on commit 996de71

Please sign in to comment.