From 80ac93be26e104b44e59db20f822b3f1b3727034 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 14 Jun 2017 17:50:45 +0000 Subject: improve rounding rules for scaling units in horizontal orientation in the terminal formatter --- usr.bin/mandoc/mdoc_term.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr.bin/mandoc/mdoc_term.c') diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c index d91ad6ef46f..3adb397fcfa 100644 --- a/usr.bin/mandoc/mdoc_term.c +++ b/usr.bin/mandoc/mdoc_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_term.c,v 1.262 2017/06/08 12:54:40 schwarze Exp $ */ +/* $OpenBSD: mdoc_term.c,v 1.263 2017/06/14 17:50:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2017 Ingo Schwarze @@ -538,7 +538,7 @@ a2width(const struct termp *p, const char *v) SCALE_HS_INIT(&su, term_strlen(p, v)); su.scale /= term_strlen(p, "0"); } - return term_hspan(p, &su) / 24; + return term_hen(p, &su); } /* @@ -684,7 +684,7 @@ termp_it_pre(DECL_ARGS) SCALE_HS_INIT(&su, term_strlen(p, bl->norm->Bl.cols[i])); su.scale /= term_strlen(p, "0"); - offset += term_hspan(p, &su) / 24 + dcol; + offset += term_hen(p, &su) + dcol; } /* @@ -702,7 +702,7 @@ termp_it_pre(DECL_ARGS) */ SCALE_HS_INIT(&su, term_strlen(p, bl->norm->Bl.cols[i])); su.scale /= term_strlen(p, "0"); - width = term_hspan(p, &su) / 24 + dcol; + width = term_hen(p, &su) + dcol; break; default: if (NULL == bl->norm->Bl.width) -- cgit v1.2.3