Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix histogram crash
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15508 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 16, 2011
1 parent 659bfe8 commit ea9d97b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -1869,6 +1869,15 @@ void QgsRasterLayerProperties::refreshHistogram()
int myBandCountInt = mRasterLayer->bandCount();
QList<QColor> myColors;
myColors << Qt::black << Qt::red << Qt::green << Qt::blue << Qt::magenta << Qt::darkRed << Qt::darkGreen << Qt::darkBlue;

while ( myColors.size() <= myBandCountInt )
{
myColors <<
QColor( 1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ) );
}

//
//now draw actual graphs
//
Expand Down

0 comments on commit ea9d97b

Please sign in to comment.