mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-19 18:13:24 -04:00
Put the charstring cursor in a local variable
This commit is contained in:
parent
e3eae733ee
commit
82447229df
15
bedstead.c
15
bedstead.c
@ -3564,10 +3564,8 @@ clean_path(void)
|
||||
} while (done_anything);
|
||||
}
|
||||
|
||||
static vec cur;
|
||||
|
||||
static void
|
||||
emit_contour(point *p0)
|
||||
emit_contour(point *p0, vec *cur)
|
||||
{
|
||||
point *p = p0, *p1;
|
||||
int stacksize = 0;
|
||||
@ -3576,11 +3574,11 @@ emit_contour(point *p0)
|
||||
do {
|
||||
stacksize += 2;
|
||||
printf(" %g %g %s\n",
|
||||
(double)(p->v.x - cur.x) / XSCALE,
|
||||
(double)(p->v.y - cur.y) / YSCALE,
|
||||
(double)(p->v.x - cur->x) / XSCALE,
|
||||
(double)(p->v.y - cur->y) / YSCALE,
|
||||
p == p0 ? "rmoveto" : stacksize >= 48 ? "rlineto" : "");
|
||||
stacksize %= 48;
|
||||
cur = p->v;
|
||||
*cur = p->v;
|
||||
p1 = p->next;
|
||||
p->prev = p->next = NULL;
|
||||
p = p1;
|
||||
@ -3593,9 +3591,8 @@ emit_path(void)
|
||||
{
|
||||
int i, pass;
|
||||
point *p;
|
||||
struct vec cur = { 0, DESCENT * YPIX };
|
||||
|
||||
cur.x = 0;
|
||||
cur.y = DESCENT * YPIX;
|
||||
/*
|
||||
* On the first pass, emit open contours (if there are any).
|
||||
* On the second pass, emit all remaining contours.
|
||||
@ -3604,7 +3601,7 @@ emit_path(void)
|
||||
for (i = 0; i < nextpoint; i++) {
|
||||
p = &points[i];
|
||||
if (p->next && (!p->prev || pass == 1))
|
||||
emit_contour(p);
|
||||
emit_contour(p, &cur);
|
||||
}
|
||||
}
|
||||
printf("endchar\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user