xref: /original-bsd/old/lib2648/line.c (revision 1a8effed)
1*1a8effedSdist /*
2*1a8effedSdist  * Copyright (c) 1980 Regents of the University of California.
3*1a8effedSdist  * All rights reserved.  The Berkeley software License Agreement
4*1a8effedSdist  * specifies the terms and conditions for redistribution.
5*1a8effedSdist  */
6*1a8effedSdist 
7*1a8effedSdist #ifndef lint
8*1a8effedSdist static char sccsid[] = "@(#)line.c	5.1 (Berkeley) 04/30/85";
9*1a8effedSdist #endif not lint
10*1a8effedSdist 
11f321161fSralph /*
12f321161fSralph  * line: draw a line from point 1 to point 2.
13f321161fSralph  */
14f321161fSralph 
15f321161fSralph #include "2648.h"
16f321161fSralph 
line(x1,y1,x2,y2)17f321161fSralph line(x1, y1, x2, y2)
18f321161fSralph int x1, y1, x2, y2;
19f321161fSralph {
20f321161fSralph #ifdef TRACE
21f321161fSralph 	if (trace)
22f321161fSralph 		fprintf(trace, "line((%d, %d), (%d, %d)),", x1, y1, x2, y2);
23f321161fSralph #endif
24f321161fSralph 	if (x1==_penx && y1==_peny) {
25f321161fSralph 		/*
26f321161fSralph 		 * Get around a bug in the HP terminal where one point
27f321161fSralph 		 * lines don't get drawn more than once.
28f321161fSralph 		 */
29f321161fSralph 		move(x1, y1+1);
30f321161fSralph 		sync();
31f321161fSralph 	}
32f321161fSralph 	move(x1, y1);
33f321161fSralph 	draw(x2, y2);
34f321161fSralph }
35