INSET(3R)

NAME
inset - inset a border for a Rectangle

SYNOPSIS
#include <dmd.h>

Rectangle inset (r, n)
Rectangle r;
int n;

DESCRIPTION
The inset function returns the Rectangle:

{ r.origin.x+n, r.origin.y+n, r.corner.x-n, r.corner.y-n } .

EXAMPLE
The following simple program creates a clear Rectangle r with a 5-dot wide border inside r:

    #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;
    }

SEE ALSO
structures(3R).