libmemdraw: remove static Point p00 and use ZP instead
This commit is contained in:
parent
5a724464d9
commit
a0acae173e
|
@ -24,9 +24,6 @@ Point corners[] = {
|
||||||
{1,-1}
|
{1,-1}
|
||||||
};
|
};
|
||||||
|
|
||||||
static
|
|
||||||
Point p00;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* make a "wedge" mask covering the desired angle and contained in
|
* make a "wedge" mask covering the desired angle and contained in
|
||||||
* a surrounding square; draw a full ellipse; intersect that with the
|
* a surrounding square; draw a full ellipse; intersect that with the
|
||||||
|
@ -101,19 +98,19 @@ memarc(Memimage *dst, Point c, int a, int b, int t, Memimage *src, Point sp, int
|
||||||
if(wedge == nil)
|
if(wedge == nil)
|
||||||
goto Return;
|
goto Return;
|
||||||
memfillcolor(wedge, DTransparent);
|
memfillcolor(wedge, DTransparent);
|
||||||
memfillpoly(wedge, bnd, i, ~0, memopaque, p00, S);
|
memfillpoly(wedge, bnd, i, ~0, memopaque, ZP, S);
|
||||||
figure = allocmemimage(rect, GREY1);
|
figure = allocmemimage(rect, GREY1);
|
||||||
if(figure == nil)
|
if(figure == nil)
|
||||||
goto Return;
|
goto Return;
|
||||||
memfillcolor(figure, DTransparent);
|
memfillcolor(figure, DTransparent);
|
||||||
memellipse(figure, p00, a, b, t, memopaque, p00, S);
|
memellipse(figure, ZP, a, b, t, memopaque, ZP, S);
|
||||||
mask = allocmemimage(rect, GREY1);
|
mask = allocmemimage(rect, GREY1);
|
||||||
if(mask == nil)
|
if(mask == nil)
|
||||||
goto Return;
|
goto Return;
|
||||||
memfillcolor(mask, DTransparent);
|
memfillcolor(mask, DTransparent);
|
||||||
memimagedraw(mask, rect, figure, rect.min, wedge, rect.min, S);
|
memimagedraw(mask, rect, figure, rect.min, wedge, rect.min, S);
|
||||||
c = subpt(c, dst->r.min);
|
c = subpt(c, dst->r.min);
|
||||||
memdraw(dst, dst->r, src, subpt(sp, c), mask, subpt(p00, c), op);
|
memdraw(dst, dst->r, src, subpt(sp, c), mask, subpt(ZP, c), op);
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
freememimage(wedge);
|
freememimage(wedge);
|
||||||
|
|
|
@ -164,8 +164,6 @@ memellipse(Memimage *dst, Point c, int a, int b, int t, Memimage *src, Point sp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Point p00 = {0, 0};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* a brushed ellipse
|
* a brushed ellipse
|
||||||
*/
|
*/
|
||||||
|
@ -180,7 +178,7 @@ bellipse(int y, State *s, Param *p)
|
||||||
if(p->disc == nil)
|
if(p->disc == nil)
|
||||||
return;
|
return;
|
||||||
memfillcolor(p->disc, DTransparent);
|
memfillcolor(p->disc, DTransparent);
|
||||||
memellipse(p->disc, p00, t, t, -1, memopaque, p00, p->op);
|
memellipse(p->disc, ZP, t, t, -1, memopaque, ZP, p->op);
|
||||||
oy = y;
|
oy = y;
|
||||||
ox = 0;
|
ox = 0;
|
||||||
nx = x = step(s);
|
nx = x = step(s);
|
||||||
|
@ -211,7 +209,7 @@ erect(int x0, int y0, int x1, int y1, Param *p)
|
||||||
|
|
||||||
/* print("R %d,%d %d,%d\n", x0, y0, x1, y1); /**/
|
/* print("R %d,%d %d,%d\n", x0, y0, x1, y1); /**/
|
||||||
r = Rect(p->c.x+x0, p->c.y+y0, p->c.x+x1+1, p->c.y+y1+1);
|
r = Rect(p->c.x+x0, p->c.y+y0, p->c.x+x1+1, p->c.y+y1+1);
|
||||||
memdraw(p->dst, r, p->src, addpt(p->sp, r.min), memopaque, p00, p->op);
|
memdraw(p->dst, r, p->src, addpt(p->sp, r.min), memopaque, ZP, p->op);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue