summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2019-03-24 20:20:39 (GMT)
committerfvogel <fvogelnew1@free.fr>2019-03-24 20:20:39 (GMT)
commitbd919c12a0d87ab9bf1bd86a114ed66898bbfcd1 (patch)
treeb037286bb5f4f01a4a2172cff4f2ba8db25d4502 /generic
parent5d23499fac449980d06f4ca3535f02a27a4052a1 (diff)
downloadtk-bd919c12a0d87ab9bf1bd86a114ed66898bbfcd1.zip
tk-bd919c12a0d87ab9bf1bd86a114ed66898bbfcd1.tar.gz
tk-bd919c12a0d87ab9bf1bd86a114ed66898bbfcd1.tar.bz2
Name the TICK_VALUES_DISPLAY_ACCURACY constant
Diffstat (limited to 'generic')
-rw-r--r--generic/tkScale.c5
-rw-r--r--generic/tkScale.h8
2 files changed, 11 insertions, 2 deletions
diff --git a/generic/tkScale.c b/generic/tkScale.c
index 8118436..c5cdaff 100644
--- a/generic/tkScale.c
+++ b/generic/tkScale.c
@@ -904,11 +904,12 @@ ComputeFormat(
leastSigDigit = ScaleDigit(scalePtr->tickInterval);
/*
- * Now add more digits until max error is less than 0.2 intervals
+ * Now add more digits until max error is less than
+ * TICK_VALUES_DISPLAY_ACCURACY intervals
*/
while (MaxTickRoundingError(scalePtr, pow(10, leastSigDigit))
- > fabs(0.2 * scalePtr->tickInterval)) {
+ > fabs(TICK_VALUES_DISPLAY_ACCURACY * scalePtr->tickInterval)) {
--leastSigDigit;
}
numDigits = 1 + mostSigDigit - leastSigDigit;
diff --git a/generic/tkScale.h b/generic/tkScale.h
index 4250b06..e68b786 100644
--- a/generic/tkScale.h
+++ b/generic/tkScale.h
@@ -217,6 +217,14 @@ typedef struct TkScale {
#define SPACING 2
/*
+ * The tick values are all displayed with the same number of decimal places.
+ * This number of decimal places is such that the displayed values are all
+ * accurate to within the following proportion of a tick interval.
+ */
+
+#define TICK_VALUES_DISPLAY_ACCURACY 0.2
+
+/*
* Declaration of procedures used in the implementation of the scale widget.
*/