File:  [Research Unix] / researchv10dc / 630 / man / src / p_man / man3 / inset.3r
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

.ds ZZ DEVELOPMENT PACKAGE
.TH INSET 3R "630 MTG"
.XE "inset()"
.SH NAME
inset \- inset a border for a Rectangle
.SH SYNOPSIS
.B #include <dmd.h>
.sp
.B Rectangle inset (r, n) 
.br
.B Rectangle r;
.br
.B int n;
.SH DESCRIPTION
The
.I inset
function returns the Rectangle:
.PP
{ \fIr.origin.x+n\fR, \fIr.origin.y+n\fR, \fIr.corner.x-n\fR, \fIr.corner.y-n\fR } .
.SH EXAMPLE
The following simple program creates a clear
Rectangle
.I r
with a 5-dot wide border inside
.IR r :
.PP
.RS 3
.ft CM
.nf
#include <dmd.h>

Rectangle inset();
Point add();

main()
{
	make_border();
	request(KBD);
	wait(KBD);
}

make_border()
{
	Rectangle r;
	Point s;
	s.x = 100;
	s.y = 100;
	
	r.origin = add(Drect.origin, s);
	r.corner = add(r.origin, s);
	rectf(&display, r, F_STORE);
	rectf(&display, inset(r, 5), F_CLR);
	return;
}

.fi
.ft R
.RE
.SH SEE ALSO
structures(3R).

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.