diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/hpgl2ps/plotdot.c |
Initial commit
Diffstat (limited to 'graphics/hpgl2ps/plotdot.c')
-rw-r--r-- | graphics/hpgl2ps/plotdot.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/graphics/hpgl2ps/plotdot.c b/graphics/hpgl2ps/plotdot.c new file mode 100644 index 0000000000..d35b09a868 --- /dev/null +++ b/graphics/hpgl2ps/plotdot.c @@ -0,0 +1,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"); + } + } +} |