mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Don't hardcode alpha in rubberband
This commit is contained in:
parent
f1ed4ae41b
commit
a463e392a2
@ -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 )
|
||||
@ -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 )
|
||||
@ -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 );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user