summaryrefslogtreecommitdiffstats
path: root/man_term.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
commit29dca53ec230c4b598c402ca964e308ca2dd627f (patch)
tree6a59b819bf4540af0b4a051be1fed72ff1323f83 /man_term.c
parent249038d8e46090d651314d34d995078a1aeb6ee9 (diff)
downloadmandoc-29dca53ec230c4b598c402ca964e308ca2dd627f.tar.gz
improve rounding rules for scaling units
in horizontal orientation in the terminal formatter
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/man_term.c b/man_term.c
index 763a3949..11431079 100644
--- a/man_term.c
+++ b/man_term.c
@@ -377,7 +377,7 @@ pre_in(DECL_ARGS)
if (a2roffsu(++cp, &su, SCALE_EN) == NULL)
return 0;
- v = (term_hspan(p, &su) + 11) / 24;
+ v = term_hen(p, &su);
if (less < 0)
p->tcol->offset -= p->tcol->offset > v ? v : p->tcol->offset;
@@ -426,7 +426,7 @@ pre_HP(DECL_ARGS)
if ((nn = n->parent->head->child) != NULL &&
a2roffsu(nn->string, &su, SCALE_EN) != NULL) {
- len = term_hspan(p, &su) / 24;
+ len = term_hen(p, &su);
if (len < 0 && (size_t)(-len) > mt->offset)
len = -mt->offset;
else if (len > SHRT_MAX)
@@ -511,7 +511,7 @@ pre_IP(DECL_ARGS)
if ((nn = n->parent->head->child) != NULL &&
(nn = nn->next) != NULL &&
a2roffsu(nn->string, &su, SCALE_EN) != NULL) {
- len = term_hspan(p, &su) / 24;
+ len = term_hen(p, &su);
if (len < 0 && (size_t)(-len) > mt->offset)
len = -mt->offset;
else if (len > SHRT_MAX)
@@ -593,7 +593,7 @@ pre_TP(DECL_ARGS)
if ((nn = n->parent->head->child) != NULL &&
nn->string != NULL && ! (NODE_LINE & nn->flags) &&
a2roffsu(nn->string, &su, SCALE_EN) != NULL) {
- len = term_hspan(p, &su) / 24;
+ len = term_hen(p, &su);
if (len < 0 && (size_t)(-len) > mt->offset)
len = -mt->offset;
else if (len > SHRT_MAX)
@@ -797,7 +797,7 @@ pre_RS(DECL_ARGS)
if (n->child == NULL)
n->aux = mt->lmargin[mt->lmargincur];
else if (a2roffsu(n->child->string, &su, SCALE_EN) != NULL)
- n->aux = term_hspan(p, &su) / 24;
+ n->aux = term_hen(p, &su);
if (n->aux < 0 && (size_t)(-n->aux) > mt->offset)
n->aux = -mt->offset;
else if (n->aux > SHRT_MAX)