From 7124f05f10769bae30b3b76cc9d89f104c9e2f0c Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 30 Jun 2010 12:27:55 +0000 Subject: Move term_hspan() calculation into the output devices, where it belongs. --- term.c | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'term.c') diff --git a/term.c b/term.c index 02dc9732..92d6e15d 100644 --- a/term.c +++ b/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.154 2010/06/28 23:26:09 kristaps Exp $ */ +/* $Id: term.c,v 1.155 2010/06/30 12:27:55 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -692,39 +692,6 @@ term_vspan(const struct termp *p, const struct roffsu *su) size_t term_hspan(const struct termp *p, const struct roffsu *su) { - double r; - - /* XXX: CM, IN, and PT are approximations. */ - switch (su->unit) { - case (SCALE_CM): - r = 4 * su->scale; - break; - case (SCALE_IN): - /* XXX: this is an approximation. */ - r = 10 * su->scale; - break; - case (SCALE_PC): - r = (10 * su->scale) / 6; - break; - case (SCALE_PT): - r = (10 * su->scale) / 72; - break; - case (SCALE_MM): - r = su->scale / 1000; /* FIXME: double-check. */ - break; - case (SCALE_VS): - r = su->scale * 2 - 1; /* FIXME: double-check. */ - break; - default: - r = su->scale; - break; - } - - if (r < 0.0) - r = 0.0; - return((size_t)/* LINTED */ - r); + return((*p->hspan)(p, su)); } - - -- cgit v1.2.3-56-ge451