summaryrefslogtreecommitdiff
path: root/graphics/hpgl2ps/rectangle.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/rectangle.c
Initial commit
Diffstat (limited to 'graphics/hpgl2ps/rectangle.c')
-rw-r--r--graphics/hpgl2ps/rectangle.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/graphics/hpgl2ps/rectangle.c b/graphics/hpgl2ps/rectangle.c
new file mode 100644
index 0000000000..3035b1f350
--- /dev/null
+++ b/graphics/hpgl2ps/rectangle.c
@@ -0,0 +1,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");
+}