forked from enlightenment/efl
parent
06c4fa8cac
commit
ea43e9004f
|
@ -221,13 +221,13 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
|
|||
|
||||
if (dx == 0)
|
||||
{
|
||||
if ((x0 >= lx) && (x0 <= rx))
|
||||
{
|
||||
if (y0 < ty) y0 = ty;
|
||||
if (y1 > by) y1 = by;
|
||||
if ((x0 >= lx) && (x0 <= rx))
|
||||
{
|
||||
if (y0 < ty) y0 = ty;
|
||||
if (y1 > by) y1 = by;
|
||||
|
||||
len = y1 - y0 + 1;
|
||||
p = dst->image.data + (dstw * y0) + x0;
|
||||
len = y1 - y0 + 1;
|
||||
p = dst->image.data + (dstw * y0) + x0;
|
||||
#ifdef HAVE_PIXMAN
|
||||
# ifdef PIXMAN_LINE
|
||||
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||
|
@ -251,84 +251,84 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
|
|||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((dy == dx) || (dy == -dx))
|
||||
{
|
||||
int p0_in, p1_in;
|
||||
int p0_in, p1_in;
|
||||
|
||||
p0_in = (IN_RECT(x0, y0, clx, cly, clw, clh) ? 1 : 0);
|
||||
p1_in = (IN_RECT(x1, y1, clx, cly, clw, clh) ? 1 : 0);
|
||||
p0_in = (IN_RECT(x0, y0, clx, cly, clw, clh) ? 1 : 0);
|
||||
p1_in = (IN_RECT(x1, y1, clx, cly, clw, clh) ? 1 : 0);
|
||||
|
||||
if (dy > 0)
|
||||
{
|
||||
if (!p0_in)
|
||||
{
|
||||
x0 = x0 + (ty - y0);
|
||||
y0 = ty;
|
||||
if (x0 > rx) return;
|
||||
if (x0 < lx)
|
||||
{
|
||||
y0 = y0 + (lx - x0);
|
||||
x0 = lx;
|
||||
if ((y0 < ty) || (y0 > by)) return;
|
||||
}
|
||||
}
|
||||
if (!p1_in)
|
||||
{
|
||||
x1 = x0 + (by - y0);
|
||||
y1 = by;
|
||||
if (x1 < lx) return;
|
||||
if (x1 > rx)
|
||||
{
|
||||
y1 = y0 + (rx - x0);
|
||||
x1 = rx;
|
||||
if ((y1 < ty) || (y1 > by)) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!p0_in)
|
||||
{
|
||||
x0 = x0 - (by - y0);
|
||||
y0 = by;
|
||||
if (x0 > rx) return;
|
||||
if (x0 < lx)
|
||||
{
|
||||
y0 = y0 - (lx - x0);
|
||||
x0 = lx;
|
||||
if ((y0 < ty) || (y0 > by)) return;
|
||||
}
|
||||
}
|
||||
if (!p1_in)
|
||||
{
|
||||
x1 = x0 - (ty - y0);
|
||||
y1 = ty;
|
||||
if (x1 < lx) return;
|
||||
if (x1 > rx)
|
||||
{
|
||||
y1 = y0 - (rx - x0);
|
||||
x1 = rx;
|
||||
if ((y1 < ty) || (y1 > by)) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (y1 > y0)
|
||||
{
|
||||
p = dst->image.data + (dstw * y0) + x0;
|
||||
len = y1 - y0 + 1;
|
||||
if (dx > 0) dstw++;
|
||||
else dstw--;
|
||||
}
|
||||
else
|
||||
{
|
||||
len = y0 - y1 + 1;
|
||||
p = dst->image.data + (dstw * y1) + x1;
|
||||
if (dx > 0) dstw--;
|
||||
else dstw++;
|
||||
}
|
||||
if (dy > 0)
|
||||
{
|
||||
if (!p0_in)
|
||||
{
|
||||
x0 = x0 + (ty - y0);
|
||||
y0 = ty;
|
||||
if (x0 > rx) return;
|
||||
if (x0 < lx)
|
||||
{
|
||||
y0 = y0 + (lx - x0);
|
||||
x0 = lx;
|
||||
if ((y0 < ty) || (y0 > by)) return;
|
||||
}
|
||||
}
|
||||
if (!p1_in)
|
||||
{
|
||||
x1 = x0 + (by - y0);
|
||||
y1 = by;
|
||||
if (x1 < lx) return;
|
||||
if (x1 > rx)
|
||||
{
|
||||
y1 = y0 + (rx - x0);
|
||||
x1 = rx;
|
||||
if ((y1 < ty) || (y1 > by)) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!p0_in)
|
||||
{
|
||||
x0 = x0 - (by - y0);
|
||||
y0 = by;
|
||||
if (x0 > rx) return;
|
||||
if (x0 < lx)
|
||||
{
|
||||
y0 = y0 - (lx - x0);
|
||||
x0 = lx;
|
||||
if ((y0 < ty) || (y0 > by)) return;
|
||||
}
|
||||
}
|
||||
if (!p1_in)
|
||||
{
|
||||
x1 = x0 - (ty - y0);
|
||||
y1 = ty;
|
||||
if (x1 < lx) return;
|
||||
if (x1 > rx)
|
||||
{
|
||||
y1 = y0 - (rx - x0);
|
||||
x1 = rx;
|
||||
if ((y1 < ty) || (y1 > by)) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (y1 > y0)
|
||||
{
|
||||
p = dst->image.data + (dstw * y0) + x0;
|
||||
len = y1 - y0 + 1;
|
||||
if (dx > 0) dstw++;
|
||||
else dstw--;
|
||||
}
|
||||
else
|
||||
{
|
||||
len = y0 - y1 + 1;
|
||||
p = dst->image.data + (dstw * y1) + x1;
|
||||
if (dx > 0) dstw--;
|
||||
else dstw++;
|
||||
}
|
||||
#ifdef HAVE_PIXMAN
|
||||
# ifdef PIXMAN_LINE
|
||||
int pixman_x_position = x0;
|
||||
|
@ -336,10 +336,8 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
|
|||
int x_unit = dstw - dst->cache_entry.w;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
while (len--)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
#ifdef HAVE_PIXMAN
|
||||
# ifdef PIXMAN_LINE
|
||||
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||
|
@ -374,7 +372,6 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#define SETUP_LINE_SHALLOW \
|
||||
if (x0 > x1) \
|
||||
{ \
|
||||
|
|
Loading…
Reference in New Issue