Skip to content

Commit

Permalink
Don't hardcode alpha in rubberband
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Aug 7, 2013
1 parent f1ed4ae commit a463e39
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui/qgsrubberband.cpp
Expand Up @@ -37,7 +37,9 @@ QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, QGis::GeometryType geomet
, mTranslationOffsetY( 0.0 )
{
reset( geometryType );
setColor( QColor( Qt::lightGray ) );
QColor color(Qt::lightGray);
color.setAlpha(63);
setColor( color );
}

QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon )
Expand All @@ -49,7 +51,9 @@ QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon )
, mTranslationOffsetY( 0.0 )
{
reset( isPolygon ? QGis::Polygon : QGis::Line );
setColor( QColor( Qt::lightGray ) );
QColor color(Qt::lightGray);
color.setAlpha(63);
setColor( color );
}

QgsRubberBand::QgsRubberBand(): QgsMapCanvasItem( 0 )
Expand All @@ -66,7 +70,7 @@ QgsRubberBand::~QgsRubberBand()
void QgsRubberBand::setColor( const QColor & color )
{
mPen.setColor( color );
QColor fillColor( color.red(), color.green(), color.blue(), 63 );
QColor fillColor( color.red(), color.green(), color.blue(), color.alpha() );
mBrush.setColor( fillColor );
mBrush.setStyle( Qt::SolidPattern );
}
Expand Down

0 comments on commit a463e39

Please sign in to comment.