forked from old/legacy-imlib2
parent
456a035996
commit
72f81a4c4d
17
src/api.c
17
src/api.c
|
@ -2946,8 +2946,11 @@ imlib_image_draw_ellipse(int xc, int yc, int a, int b)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
__imlib_draw_ellipse(im, xc, yc, a, b, ctxt_color.red, ctxt_color.green,
|
__imlib_draw_ellipse_clipped(im, xc, yc, a, b, 0,
|
||||||
ctxt_color.blue, ctxt_color.alpha, ctxt_operation);
|
im->w - 1, 0, im->h - 1,
|
||||||
|
ctxt_color.red, ctxt_color.green,
|
||||||
|
ctxt_color.blue, ctxt_color.alpha,
|
||||||
|
ctxt_operation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2966,11 +2969,11 @@ imlib_image_fill_ellipse(int xc, int yc, int a, int b)
|
||||||
__imlib_DirtyPixmapsForImage(im);
|
__imlib_DirtyPixmapsForImage(im);
|
||||||
|
|
||||||
__imlib_fill_ellipse(im, xc, yc, a, b, ctxt_cliprect.x,
|
__imlib_fill_ellipse(im, xc, yc, a, b, ctxt_cliprect.x,
|
||||||
ctxt_cliprect.x + ctxt_cliprect.w,
|
ctxt_cliprect.x + ctxt_cliprect.w - 1,
|
||||||
ctxt_cliprect.y,
|
ctxt_cliprect.y,
|
||||||
ctxt_cliprect.y + ctxt_cliprect.h, ctxt_color.red,
|
ctxt_cliprect.y + ctxt_cliprect.h - 1, ctxt_color.red,
|
||||||
ctxt_color.green, ctxt_color.blue, ctxt_color.alpha,
|
ctxt_color.green, ctxt_color.blue, ctxt_color.alpha,
|
||||||
ctxt_operation, ctxt_anti_alias);
|
ctxt_operation, ctxt_anti_alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1927,11 +1927,17 @@ __imlib_fill_ellipse(ImlibImage * im, int xc, int yc, int aa, int bb,
|
||||||
for (x = 0, y = bb, dec = 2 * b2 + a2 * (1 - 2 * bb); b2 * x <= a2 * y;
|
for (x = 0, y = bb, dec = 2 * b2 + a2 * (1 - 2 * bb); b2 * x <= a2 * y;
|
||||||
x++)
|
x++)
|
||||||
{
|
{
|
||||||
table1[yc - y].x = xc - x;
|
if (((yc - y) >= 0) && ((yc - y) < im->h))
|
||||||
table2[yc - y].x = xc + x;
|
{
|
||||||
|
table1[yc - y].x = xc - x;
|
||||||
|
table2[yc - y].x = xc + x;
|
||||||
|
}
|
||||||
|
|
||||||
table1[yc + y].x = xc - x;
|
if (((yc + y) >= 0) && ((yc + y) < im->h))
|
||||||
table2[yc + y].x = xc + x;
|
{
|
||||||
|
table1[yc + y].x = xc - x;
|
||||||
|
table2[yc + y].x = xc + x;
|
||||||
|
}
|
||||||
|
|
||||||
if (dec >= 0.0)
|
if (dec >= 0.0)
|
||||||
dec += 4.0 * a2 * (1 - (y--));
|
dec += 4.0 * a2 * (1 - (y--));
|
||||||
|
@ -1941,11 +1947,17 @@ __imlib_fill_ellipse(ImlibImage * im, int xc, int yc, int aa, int bb,
|
||||||
for (x = aa, y = 0, dec = 2 * a2 + b2 * (1 - 2 * aa); a2 * y <= b2 * x;
|
for (x = aa, y = 0, dec = 2 * a2 + b2 * (1 - 2 * aa); a2 * y <= b2 * x;
|
||||||
y++)
|
y++)
|
||||||
{
|
{
|
||||||
table1[yc - y].x = xc - x;
|
if (((yc - y) >= 0) && ((yc - y) < im->h))
|
||||||
table2[yc - y].x = xc + x;
|
{
|
||||||
|
table1[yc - y].x = xc - x;
|
||||||
|
table2[yc - y].x = xc + x;
|
||||||
|
}
|
||||||
|
|
||||||
table1[yc + y].x = xc - x;
|
if (((yc + y) >= 0) && ((yc + y) < im->h))
|
||||||
table2[yc + y].x = xc + x;
|
{
|
||||||
|
table1[yc + y].x = xc - x;
|
||||||
|
table2[yc + y].x = xc + x;
|
||||||
|
}
|
||||||
|
|
||||||
if (dec >= 0)
|
if (dec >= 0)
|
||||||
dec += 4 * b2 * (1 - (x--));
|
dec += 4 * b2 * (1 - (x--));
|
||||||
|
@ -1960,21 +1972,31 @@ __imlib_fill_ellipse(ImlibImage * im, int xc, int yc, int aa, int bb,
|
||||||
__spanlist_clip(table1, table2, &miny, &maxy, clip_xmin, clip_xmax,
|
__spanlist_clip(table1, table2, &miny, &maxy, clip_xmin, clip_xmax,
|
||||||
clip_ymin, clip_ymax);
|
clip_ymin, clip_ymax);
|
||||||
|
|
||||||
if (antialias)
|
if (miny < 0) miny = 0;
|
||||||
{
|
if (miny >= im->h)
|
||||||
do
|
{
|
||||||
{
|
free(table1);
|
||||||
/* spanAA(im, miny, table1, table2, r, g, b, a, op);*/
|
free(table2);
|
||||||
miny++;
|
return;
|
||||||
}
|
}
|
||||||
while (miny < maxy);
|
if (maxy < 0)
|
||||||
}
|
{
|
||||||
else
|
free(table1);
|
||||||
|
free(table2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (maxy >= im->h) maxy = im->h - 1;
|
||||||
{
|
{
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
span(im, miny, table1[miny].x, table2[miny].x, r, g, b, a, op);
|
int x1, x2;
|
||||||
|
|
||||||
|
x1 = table1[miny].x;
|
||||||
|
x2 = table2[miny].x;
|
||||||
|
if (x1 < clip_xmin) x1 = clip_xmin;
|
||||||
|
if (x2 > clip_xmax) x2 = clip_xmax;
|
||||||
|
span(im, miny, x1, x2, r, g, b, a, op);
|
||||||
miny++;
|
miny++;
|
||||||
}
|
}
|
||||||
while (miny < maxy);
|
while (miny < maxy);
|
||||||
|
|
Loading…
Reference in New Issue