mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
fix for bug in continuous color renderer which appeared if the minimum and the maximum value of a classification field are the same
git-svn-id: http://svn.osgeo.org/qgis/trunk@1120 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
6ac08e261e
commit
08a26d4f53
@ -188,9 +188,20 @@ void QgsContinuousColRenderer::renderFeature(QPainter * p, QgsFeature * f, QPict
|
||||
maxcolor = mMaximumItem->getSymbol()->fillColor();
|
||||
}
|
||||
|
||||
int red = int (maxcolor.red() * (fvalue - minvalue) / (maxvalue - minvalue) + mincolor.red() * (maxvalue - fvalue) / (maxvalue - minvalue));
|
||||
int green = int (maxcolor.green() * (fvalue - minvalue) / (maxvalue - minvalue) + mincolor.green() * (maxvalue - fvalue) / (maxvalue - minvalue));
|
||||
int blue = int (maxcolor.blue() * (fvalue - minvalue) / (maxvalue - minvalue) + mincolor.blue() * (maxvalue - fvalue) / (maxvalue - minvalue));
|
||||
int red,green,blue;
|
||||
|
||||
if((maxvalue - minvalue)!=0)
|
||||
{
|
||||
red = int (maxcolor.red() * (fvalue - minvalue) / (maxvalue - minvalue) + mincolor.red() * (maxvalue - fvalue) / (maxvalue - minvalue));
|
||||
green = int (maxcolor.green() * (fvalue - minvalue) / (maxvalue - minvalue) + mincolor.green() * (maxvalue - fvalue) / (maxvalue - minvalue));
|
||||
blue = int (maxcolor.blue() * (fvalue - minvalue) / (maxvalue - minvalue) + mincolor.blue() * (maxvalue - fvalue) / (maxvalue - minvalue));
|
||||
}
|
||||
else
|
||||
{
|
||||
red = int (mincolor.red());
|
||||
green = int (mincolor.green());
|
||||
blue = int (mincolor.blue());
|
||||
}
|
||||
|
||||
if (wkbType == QGis::WKBLineString || wkbType == QGis::WKBMultiLineString ||wkbType == QGis::WKBPoint)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user