File: segment.c

package info (click to toggle)
sam 4.3-14
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,456 kB
  • ctags: 1,673
  • sloc: ansic: 14,328; sh: 1,307; makefile: 315
file content (24 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (20)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Copyright (c) 1992 AT&T - All rights reserved. */
#include <libc.h>
#include <libg.h>
#include "libgint.h"

void
segment(Bitmap *d, Point p1, Point p2, int v, Fcode f)
{
	int x1, y1, x2, y2;
	GC g;

	x1 = p1.x;
	y1 = p1.y;
	x2 = p2.x;
	y2 = p2.y;
	if(d->flag&SHIFT){
		x1 -= d->r.min.x;
		y1 -= d->r.min.y;
		x2 -= d->r.min.x;
		y2 -= d->r.min.y;
	}
	g = _getfillgc(f, d, v);
	XDrawLine(_dpy, (Drawable)d->id, g, x1, y1, x2, y2);
}