summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-09-21 19:44:21 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-09-21 19:44:21 (GMT)
commit9b8c9769c0b7ad4e232550609f8e99d3d5b24f3c (patch)
tree278a819ad72c9a5885f59651e2e1d6de34f2b7bd
parent102cc58b734175657d3112ccf51f6159bfd04518 (diff)
downloadblt-9b8c9769c0b7ad4e232550609f8e99d3d5b24f3c.zip
blt-9b8c9769c0b7ad4e232550609f8e99d3d5b24f3c.tar.gz
blt-9b8c9769c0b7ad4e232550609f8e99d3d5b24f3c.tar.bz2
Axis tick labels: zero out any extremely small numbersv3.2.11
-rw-r--r--generic/tkbltGrAxis.C4
1 files changed, 4 insertions, 0 deletions
diff --git a/generic/tkbltGrAxis.C b/generic/tkbltGrAxis.C
index 8532600..418abbb 100644
--- a/generic/tkbltGrAxis.C
+++ b/generic/tkbltGrAxis.C
@@ -1049,6 +1049,10 @@ TickLabel* Axis::makeLabel(double value)
char string[TICK_LABEL_SIZE + 1];
+ // zero out any extremely small numbers
+ if (value<DBL_EPSILON && value>-DBL_EPSILON)
+ value =0;
+
if (ops->tickFormat && *ops->tickFormat) {
snprintf(string, TICK_LABEL_SIZE, ops->tickFormat, value);
} else if (ops->logScale) {