Commit 5f91848 1 parent 2a2f4ce commit 5f91848 Copy full SHA for 5f91848
File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -493,7 +493,8 @@ void QgsRasterHistogramWidget::refreshHistogram()
493
493
#endif
494
494
495
495
// calculate first bin x value and bin step size if not Byte data
496
- if ( mRasterLayer ->dataProvider ()->srcDataType ( myIteratorInt ) != QGis::Byte )
496
+ QGis::DataType mySrcDataType = mRasterLayer ->dataProvider ()->srcDataType ( myIteratorInt );
497
+ if ( mySrcDataType != QGis::Byte )
497
498
{
498
499
myBinXStep = ( myHistogram.maximum - myHistogram.minimum ) / myHistogram.binCount ;
499
500
myBinX = myHistogram.minimum + myBinXStep / 2.0 ;
@@ -502,12 +503,16 @@ void QgsRasterHistogramWidget::refreshHistogram()
502
503
{
503
504
myBinXStep = 1 ;
504
505
myBinX = 0 ;
506
+ }
505
507
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
506
- // TODO add support for Int16/Int32 types - this requires fixing the sampleSize and/or min/max
507
- if ( ! mHistoDrawLines )
508
- myDrawLines = false ;
509
- #endif
508
+ if ( ! mHistoDrawLines &&
509
+ ( mySrcDataType == QGis::Byte ||
510
+ mySrcDataType == QGis::Int16 || mySrcDataType == QGis::Int32 ||
511
+ mySrcDataType == QGis::UInt16 || mySrcDataType == QGis::UInt32 ) )
512
+ {
513
+ myDrawLines = false ;
510
514
}
515
+ #endif
511
516
512
517
for ( int myBin = 0 ; myBin < myHistogram.binCount ; myBin++ )
513
518
{
You can’t perform that action at this time.
0 commit comments