aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitd687586337f23b878d3678fc908d2c30b540a058 (patch)
tree4690c1992cd85292996a523727c3307ab8f10c45 /man_term.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 'man_term.c')
-rw-r--r--man_term.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/man_term.c b/man_term.c
index 7f026ce9..a2cc1f0c 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.204 2017/06/08 12:54:58 schwarze Exp $ */
+/* $Id: man_term.c,v 1.205 2017/06/14 17:51:15 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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)