summaryrefslogtreecommitdiff
path: root/utils/hp2ps/Marks.c
blob: feb341ee0394d284475a22c8f47569576c6274a1 (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
40
41
42
#include "Main.h"
#include <stdio.h>
#include "Curves.h"
#include "Dimensions.h"
#include "HpFile.h"

/* own stuff */
#include "Marks.h"

static void Caret PROTO((floatish, floatish, floatish));

void
Marks(void)
{
    intish i;
    floatish m;

    for (i = 0; i < nmarks; i++) {
	m = ((markmap[i] - samplemap[0]) / xrange) * graphwidth;
	Caret(xpage(m), ypage(0.0), 4.0);
    }
}


/*
 * Draw a small white caret at (x,y) with width 2 * d
 */

static void
Caret(floatish x, floatish y, floatish d)
{
    fprintf(psfp, "%f %f moveto\n", x - d, y);
    fprintf(psfp, "%f %f rlineto\n",  d, -d);
    fprintf(psfp, "%f %f rlineto\n",  d,  d);
    fprintf(psfp, "closepath\n");

    fprintf(psfp, "gsave\n");
    fprintf(psfp, "1.0 setgray\n");
    fprintf(psfp, "fill\n");
    fprintf(psfp, "grestore\n");
    fprintf(psfp, "stroke\n");
}