File: segment.c

package info (click to toggle)
wily 0.13.41-7.3
  • links: PTS
  • area: main
  • in suites: buster
  • size: 2,560 kB
  • ctags: 3,426
  • sloc: ansic: 25,364; perl: 580; makefile: 448; sh: 415; python: 30; exp: 17
file content (24 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (18)
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);
}