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;
|
return accept;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImlibOutCode
|
ImlibOutCode __imlib_comp_outcode(double x, double y, double xmin,
|
||||||
__imlib_comp_outcode(double x, double y, double xmin, double xmax,
|
double xmax, double ymin, double ymax)
|
||||||
double ymin, double ymax)
|
|
||||||
{
|
{
|
||||||
ImlibOutCode code = 0;
|
ImlibOutCode code = 0;
|
||||||
|
|
||||||
|
@ -1646,7 +1645,8 @@ __imlib_comp_outcode(double x, double y, double xmin, double xmax,
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImlibPoly __imlib_polygon_new()
|
ImlibPoly
|
||||||
|
__imlib_polygon_new()
|
||||||
{
|
{
|
||||||
ImlibPoly poly;
|
ImlibPoly poly;
|
||||||
|
|
||||||
|
@ -1840,12 +1840,17 @@ __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;
|
for (x = 0, y = bb, dec = 2 * b2 + a2 * (1 - 2 * bb); b2 * x <= a2 * y;
|
||||||
x++)
|
x++)
|
||||||
{
|
{
|
||||||
for (i = yc - y; i <= yc + y; i++)
|
if ((i >= clip_ymin) && (i <= clip_ymax))
|
||||||
{
|
{
|
||||||
__imlib_draw_set_point_clipped(im, xc - x, i, clip_xmin, clip_xmax,
|
for (i = yc - y; i <= yc + y; i++)
|
||||||
clip_ymin, clip_ymax, r, g, b, a, op);
|
{
|
||||||
__imlib_draw_set_point_clipped(im, xc + x, i, clip_xmin, clip_xmax,
|
__imlib_draw_set_point_clipped(im, xc - x, i, clip_xmin,
|
||||||
clip_ymin, clip_ymax, r, g, b, a, op);
|
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)
|
if (dec >= 0)
|
||||||
|
@ -1856,14 +1861,19 @@ __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;
|
for (x = aa, y = 0, dec = 2 * a2 + b2 * (1 - 2 * aa); a2 * y <= b2 * x;
|
||||||
y++)
|
y++)
|
||||||
{
|
{
|
||||||
for (i = yc - y; i <= yc + y; i++)
|
if ((i >= clip_ymin) && (i <= clip_ymax))
|
||||||
{
|
{
|
||||||
__imlib_draw_set_point_clipped(im, xc + x, i, clip_xmin, clip_xmax,
|
for (i = yc - y; i <= yc + y; i++)
|
||||||
clip_ymin, clip_ymax, r, g, b, a, op);
|
{
|
||||||
__imlib_draw_set_point_clipped(im, xc - x, i, clip_xmin, clip_xmax,
|
__imlib_draw_set_point_clipped(im, xc + x, i, clip_xmin,
|
||||||
clip_ymin, clip_ymax, r, g, b, a, op);
|
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)
|
if (dec >= 0)
|
||||||
dec += 4 * b2 * (1 - (x--));
|
dec += 4 * b2 * (1 - (x--));
|
||||||
dec += a2 * (4 * y + 6);
|
dec += a2 * (4 * y + 6);
|
||||||
|
@ -1925,7 +1935,7 @@ __imlib_draw_set_point(ImlibImage * im, int x, int y, DATA8 r, DATA8 g,
|
||||||
DATA32 *p;
|
DATA32 *p;
|
||||||
int tmp;
|
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]);
|
p = &(im->data[(im->w * y) + x]);
|
||||||
switch (op)
|
switch (op)
|
||||||
|
|
|
@ -849,7 +849,7 @@ int main (int argc, char **argv)
|
||||||
imlib_context_set_cliprect(0,0,0,0);
|
imlib_context_set_cliprect(0,0,0,0);
|
||||||
|
|
||||||
/* test polygons */
|
/* test polygons */
|
||||||
imlib_context_set_color(255, 0, 0, 255);
|
imlib_context_set_color(255, 0, 0, 128);
|
||||||
imlib_image_fill_polygon(poly);
|
imlib_image_fill_polygon(poly);
|
||||||
imlib_context_set_color(255, 255, 255, 255);
|
imlib_context_set_color(255, 255, 255, 255);
|
||||||
imlib_image_draw_polygon(poly2,0);
|
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_color(255, 55, 55, 255);
|
||||||
imlib_context_set_cliprect(380,260,50,50);
|
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);
|
imlib_context_set_cliprect(0,0,0,0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue