summaryrefslogtreecommitdiff
path: root/graphics/hpgl2ps/plotdot.c
blob: d35b09a868089aba3e2dca2bf8bdd32a86fde0b3 (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
30
31
32
33
34
35
36
37
38
39
/*
 * Plot a dot or symbol on the paper 
 */
#include "defn.h"

plotdot(type)
char   *type;
{
    end_draw();

    while (SIGNED_NUMERIC)
    {
	xval = getval() * XSCALE;
	yval = getval() * YSCALE;
	if (type == RMOVE)
	{
	    absX += xval;
	    absY += yval;
	} else
	if (type == MOVE)
	{
	    absX = xval;
	    absY = yval;
	} else
	{
	    fprintf(stderr, "Error: expecting move command not %s\n", type);
	    exit(1);
	}

	if (SYMBOL)
	    printf("%g %g 5 %g (%c) Text\n", absX, absY, char_angle, symbol);
    	else if (SETDOT)
	{
    	    printf("newpath\n");
    	    printf("  %g %g %s %g %g %s\n", absX, absY, MOVE, absX, absY, DRAW);
	    printf("stroke\n");
	}
    }
}