forked from old/legacy-imlib2
parent
cdf8e6ed76
commit
82824227fc
|
@ -1629,9 +1629,8 @@ imlib_clip_line(int x0, int y0, int x1, int y1, int xmin, int xmax, int ymin,
|
|||
return accept;
|
||||
}
|
||||
|
||||
ImlibOutCode
|
||||
__imlib_comp_outcode(double x, double y, double xmin, double xmax,
|
||||
double ymin, double ymax)
|
||||
ImlibOutCode __imlib_comp_outcode(double x, double y, double xmin,
|
||||
double xmax, double ymin, double ymax)
|
||||
{
|
||||
ImlibOutCode code = 0;
|
||||
|
||||
|
@ -1646,7 +1645,8 @@ __imlib_comp_outcode(double x, double y, double xmin, double xmax,
|
|||
return code;
|
||||
}
|
||||
|
||||
ImlibPoly __imlib_polygon_new()
|
||||
ImlibPoly
|
||||
__imlib_polygon_new()
|
||||
{
|
||||
ImlibPoly poly;
|
||||
|
||||
|
@ -1839,13 +1839,18 @@ __imlib_fill_ellipse_clipped(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;
|
||||
x++)
|
||||
{
|
||||
if ((i >= clip_ymin) && (i <= clip_ymax))
|
||||
{
|
||||
for (i = yc - y; i <= yc + y; i++)
|
||||
{
|
||||
__imlib_draw_set_point_clipped(im, xc - x, i, clip_xmin, clip_xmax,
|
||||
clip_ymin, clip_ymax, r, g, b, a, op);
|
||||
__imlib_draw_set_point_clipped(im, xc + x, i, clip_xmin, clip_xmax,
|
||||
clip_ymin, clip_ymax, r, g, b, a, op);
|
||||
__imlib_draw_set_point_clipped(im, xc - x, i, clip_xmin,
|
||||
clip_xmax, clip_ymin, clip_ymax, r,
|
||||
g, b, a, op);
|
||||
__imlib_draw_set_point_clipped(im, xc + x, i, clip_xmin,
|
||||
clip_xmax, clip_ymin, clip_ymax, r,
|
||||
g, b, a, op);
|
||||
}
|
||||
}
|
||||
|
||||
if (dec >= 0)
|
||||
|
@ -1855,13 +1860,18 @@ __imlib_fill_ellipse_clipped(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;
|
||||
y++)
|
||||
{
|
||||
if ((i >= clip_ymin) && (i <= clip_ymax))
|
||||
{
|
||||
for (i = yc - y; i <= yc + y; i++)
|
||||
{
|
||||
__imlib_draw_set_point_clipped(im, xc + x, i, clip_xmin, clip_xmax,
|
||||
clip_ymin, clip_ymax, r, g, b, a, op);
|
||||
__imlib_draw_set_point_clipped(im, xc - x, i, clip_xmin, clip_xmax,
|
||||
clip_ymin, clip_ymax, r, g, b, a, op);
|
||||
__imlib_draw_set_point_clipped(im, xc + x, i, clip_xmin,
|
||||
clip_xmax, clip_ymin, clip_ymax, r,
|
||||
g, b, a, op);
|
||||
__imlib_draw_set_point_clipped(im, xc - x, i, clip_xmin,
|
||||
clip_xmax, clip_ymin, clip_ymax, r,
|
||||
g, b, a, op);
|
||||
}
|
||||
}
|
||||
|
||||
if (dec >= 0)
|
||||
|
@ -1925,7 +1935,7 @@ __imlib_draw_set_point(ImlibImage * im, int x, int y, DATA8 r, DATA8 g,
|
|||
DATA32 *p;
|
||||
int tmp;
|
||||
|
||||
if ((x >= 0 && x < im->w) && (y >= 0 && y <= im->h))
|
||||
if (XY_IN_RECT(x, y, 0, 0, im->w, im->h))
|
||||
{
|
||||
p = &(im->data[(im->w * y) + x]);
|
||||
switch (op)
|
||||
|
|
|
@ -849,7 +849,7 @@ int main (int argc, char **argv)
|
|||
imlib_context_set_cliprect(0,0,0,0);
|
||||
|
||||
/* test polygons */
|
||||
imlib_context_set_color(255, 0, 0, 255);
|
||||
imlib_context_set_color(255, 0, 0, 128);
|
||||
imlib_image_fill_polygon(poly);
|
||||
imlib_context_set_color(255, 255, 255, 255);
|
||||
imlib_image_draw_polygon(poly2,0);
|
||||
|
@ -858,7 +858,7 @@ int main (int argc, char **argv)
|
|||
|
||||
imlib_context_set_color(255, 55, 55, 255);
|
||||
imlib_context_set_cliprect(380,260,50,50);
|
||||
imlib_image_draw_polygon(poly3,1);
|
||||
imlib_image_fill_polygon(poly3);
|
||||
imlib_context_set_cliprect(0,0,0,0);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue