summaryrefslogtreecommitdiff
path: root/dviware/beebe/src/movedown.h
blob: fbf290ed12a726afe945ecde7baa9b05c6f80a39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* -*-C-*- movedown.h */
/*-->movedown*/
/**********************************************************************/
/****************************** movedown ******************************/
/**********************************************************************/

void
movedown(a)
register INT32 a;

{
    /*	From DVITYPE Version 2.6:
	"Vertical motion is done similarly [to horizontal motion handled
	in moveover()],  but with  the threshold  between ``small''  and
	``large'' increased by  a factor of  five. The idea  is to  make
	fractions  like  ``1/2''  round  consistently,  but  to   absorb
	accumulated rounding errors in the baseline-skip moves."

	The one precaution we need to  take here is that fontptr can  be
	NULL, which we treat like  a large movement.  This NULL  pointer
	was used without error  on many different  machines for 2  years
	before it was caught on the VAX VMS implementation, which  makes
	memory page 0 inaccessible.
    */
    v += a;
    if ((fontptr == (struct font_entry *)NULL) ||
        (ABS(a) >= 5*fontptr->font_space))
	vv = PIXROUND(v, conv) + tmargin;
    else
    {
	vv += PIXROUND(a, conv);
	vv = fixpos(vv-tmargin,v,conv) + tmargin;
    }
}