Skip to content

Commit

Permalink
fix histogram crash
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15508 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 16, 2011
1 parent 59ce32e commit 768ce9c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
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 768ce9c

Please sign in to comment.