aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term_tab.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-14 17:51:15 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-14 17:51:15 +0000
commitd687586337f23b878d3678fc908d2c30b540a058 (patch)
tree4690c1992cd85292996a523727c3307ab8f10c45 /term_tab.c
parent98b1f2affc51ab2505cc48390d8ea926eaac9e03 (diff)
downloadmandoc-d687586337f23b878d3678fc908d2c30b540a058.tar.gz
mandoc-d687586337f23b878d3678fc908d2c30b540a058.tar.zst
mandoc-d687586337f23b878d3678fc908d2c30b540a058.zip
improve rounding rules for scaling units
in horizontal orientation in the terminal formatter
Diffstat (limited to 'term_tab.c')
-rw-r--r--term_tab.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/term_tab.c b/term_tab.c
index 88c47c18..2acfd46a 100644
--- a/term_tab.c
+++ b/term_tab.c
@@ -52,7 +52,7 @@ term_tab_set(const struct termp *p, const char *arg)
recording_period = 0;
if (tabs.d == 0) {
a2roffsu(".8i", &su, SCALE_IN);
- tabs.d = term_hspan(p, &su) / 24;
+ tabs.d = term_hen(p, &su);
}
return;
}
@@ -81,7 +81,7 @@ term_tab_set(const struct termp *p, const char *arg)
/* Append the new position. */
- pos = term_hspan(p, &su);
+ pos = term_hen(p, &su);
tl->t[tl->n] = pos;
if (add && tl->n)
tl->t[tl->n] += tl->t[tl->n - 1];
@@ -97,10 +97,6 @@ term_tab_next(size_t prev)
if (i == tabs.a.n) {
if (tabs.p.n == 0)
return prev;
-/*
- return i ? prev :
- (prev / tabs.d + 1) * tabs.d;
- */
tabs.a.n += tabs.p.n;
if (tabs.a.s < tabs.a.n) {
tabs.a.s = tabs.a.n;
@@ -111,7 +107,7 @@ term_tab_next(size_t prev)
tabs.a.t[i + j] = tabs.p.t[j] +
(i ? tabs.a.t[i - 1] : 0);
}
- if (prev < tabs.a.t[i] / 24)
- return tabs.a.t[i] / 24;
+ if (prev < tabs.a.t[i])
+ return tabs.a.t[i];
}
}