xref: /csrg-svn/old/lib2648/line.c (revision 19794)
111477Sralph /*
2*19794Sdist  * Copyright (c) 1980 Regents of the University of California.
3*19794Sdist  * All rights reserved.  The Berkeley software License Agreement
4*19794Sdist  * specifies the terms and conditions for redistribution.
5*19794Sdist  */
6*19794Sdist 
7*19794Sdist #ifndef lint
8*19794Sdist static char sccsid[] = "@(#)line.c	5.1 (Berkeley) 04/30/85";
9*19794Sdist #endif not lint
10*19794Sdist 
11*19794Sdist /*
1211477Sralph  * line: draw a line from point 1 to point 2.
1311477Sralph  */
1411477Sralph 
1511477Sralph #include "2648.h"
1611477Sralph 
line(x1,y1,x2,y2)1711477Sralph line(x1, y1, x2, y2)
1811477Sralph int x1, y1, x2, y2;
1911477Sralph {
2011477Sralph #ifdef TRACE
2111477Sralph 	if (trace)
2211477Sralph 		fprintf(trace, "line((%d, %d), (%d, %d)),", x1, y1, x2, y2);
2311477Sralph #endif
2411477Sralph 	if (x1==_penx && y1==_peny) {
2511477Sralph 		/*
2611477Sralph 		 * Get around a bug in the HP terminal where one point
2711477Sralph 		 * lines don't get drawn more than once.
2811477Sralph 		 */
2911477Sralph 		move(x1, y1+1);
3011477Sralph 		sync();
3111477Sralph 	}
3211477Sralph 	move(x1, y1);
3311477Sralph 	draw(x2, y2);
3411477Sralph }
35