Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
draw histogram boxes for Int16/Int32 also
  • Loading branch information
etiennesky committed Feb 22, 2014
1 parent 2a2f4ce commit 5f91848
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/gui/raster/qgsrasterhistogramwidget.cpp
Expand Up @@ -493,7 +493,8 @@ void QgsRasterHistogramWidget::refreshHistogram()
#endif

// calculate first bin x value and bin step size if not Byte data
if ( mRasterLayer->dataProvider()->srcDataType( myIteratorInt ) != QGis::Byte )
QGis::DataType mySrcDataType = mRasterLayer->dataProvider()->srcDataType( myIteratorInt );
if ( mySrcDataType != QGis::Byte )
{
myBinXStep = ( myHistogram.maximum - myHistogram.minimum ) / myHistogram.binCount;
myBinX = myHistogram.minimum + myBinXStep / 2.0;
Expand All @@ -502,12 +503,16 @@ void QgsRasterHistogramWidget::refreshHistogram()
{
myBinXStep = 1;
myBinX = 0;
}
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
// TODO add support for Int16/Int32 types - this requires fixing the sampleSize and/or min/max
if ( ! mHistoDrawLines )
myDrawLines = false;
#endif
if ( ! mHistoDrawLines &&
( mySrcDataType == QGis::Byte ||
mySrcDataType == QGis::Int16 || mySrcDataType == QGis::Int32 ||
mySrcDataType == QGis::UInt16 || mySrcDataType == QGis::UInt32 ) )
{
myDrawLines = false;
}
#endif

for ( int myBin = 0; myBin < myHistogram.binCount; myBin++ )
{
Expand Down

0 comments on commit 5f91848

Please sign in to comment.