summaryrefslogtreecommitdiff
path: root/graphics/hpgl2ps/rectangle.c
blob: 3035b1f3506a83279bce43f438c9ffdcf067b6d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "defn.h"

rectangle()
{
    int		hatch;
    float	width, height;
    float	hatch_spacing;
    float	hatch_angle;
    
    if (SIGNED_NUMERIC)
	hatch = getval();
    if (SIGNED_NUMERIC)
	width = getval() * XSCALE;
    if (SIGNED_NUMERIC)
	height = getval() * YSCALE;
    if (SIGNED_NUMERIC)
	hatch_spacing = getval() * XSCALE;
    if (SIGNED_NUMERIC)
	hatch_angle = getval();

    end_draw();
    printf("%g %g M\n", xval, yval);
    printf("%g 0 I\n", width);
    printf("0 %g I\n", height);
    printf("-%g 0 I\n", width);
    printf("closepath stroke\n");
    if (hatch != 2)
        fprintf(stderr, "Warning: Cross hatching not implemented yet\n");
}