summaryrefslogtreecommitdiff
path: root/graphics/hpgl2ps/plotdot.c
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/hpgl2ps/plotdot.c
Initial commit
Diffstat (limited to 'graphics/hpgl2ps/plotdot.c')
-rw-r--r--graphics/hpgl2ps/plotdot.c39
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");
+ }
+ }
+}