Skip to content

Commit aad8027

Browse files
committed
allow to create a QgsGeometryRubberBand as the alternative band
1 parent 7afa9e3 commit aad8027

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/gui/qgsmaptooledit.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,19 @@ int QgsMapToolEdit::addTopologicalPoints( const QList<QgsPoint>& geom )
9797
return 0;
9898
}
9999

100-
QgsGeometryRubberBand* QgsMapToolEdit::createGeometryRubberBand( QGis::GeometryType geometryType ) const
100+
QgsGeometryRubberBand* QgsMapToolEdit::createGeometryRubberBand( QGis::GeometryType geometryType, bool alternativeBand ) const
101101
{
102102
QSettings settings;
103103
QgsGeometryRubberBand* rb = new QgsGeometryRubberBand( mCanvas, geometryType );
104104
QColor color( settings.value( "/qgis/digitizing/line_color_red", 255 ).toInt(),
105105
settings.value( "/qgis/digitizing/line_color_green", 0 ).toInt(),
106106
settings.value( "/qgis/digitizing/line_color_blue", 0 ).toInt() );
107107
double myAlpha = settings.value( "/qgis/digitizing/line_color_alpha", 200 ).toInt() / 255.0 ;
108+
if ( alternativeBand )
109+
{
110+
myAlpha = myAlpha * settings.value( "/qgis/digitizing/line_color_alpha_scale", 0.75 ).toDouble();
111+
rb->setLineStyle( Qt::DotLine );
112+
}
108113
color.setAlphaF( myAlpha );
109114
rb->setOutlineColor( color );
110115
rb->setFillColor( color );

src/gui/qgsmaptooledit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class GUI_EXPORT QgsMapToolEdit: public QgsMapTool
4949
*/
5050
QgsRubberBand* createRubberBand( QGis::GeometryType geometryType = QGis::Line, bool alternativeBand = false );
5151

52-
QgsGeometryRubberBand* createGeometryRubberBand( QGis::GeometryType geometryType = QGis::Line ) const;
52+
QgsGeometryRubberBand* createGeometryRubberBand( QGis::GeometryType geometryType = QGis::Line , bool alternativeBand = false ) const;
5353

5454
/** Returns the current vector layer of the map canvas or 0*/
5555
QgsVectorLayer* currentVectorLayer();

0 commit comments

Comments
 (0)