We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent a343cb7 commit 78e59c9Copy full SHA for 78e59c9
src/gui/qgshighlight.cpp
@@ -380,7 +380,7 @@ void QgsHighlight::paint( QPainter* p )
380
imagePainter->end();
381
382
QColor color( mPen.color() ); // true output color
383
- // coeficient to subtract alpha using green (temporary fill)
+ // coefficient to subtract alpha using green (temporary fill)
384
double k = ( 255. - mBrush.color().alpha() ) / 255.;
385
for ( int r = 0; r < image.height(); r++ )
386
{
@@ -391,7 +391,7 @@ void QgsHighlight::paint( QPainter* p )
391
if ( alpha > 0 )
392
393
int green = qGreen( rgba );
394
- color.setAlpha( alpha - ( green * k ) );
+ color.setAlpha( qBound<int>( 0, alpha - ( green * k ), 255 ) );
395
396
image.setPixel( c, r, color.rgba() );
397
}
0 commit comments