Don't divide by 0.

SVN revision: 16216
This commit is contained in:
sebastid 2005-08-17 00:30:09 +00:00 committed by sebastid
parent 3682e40ecc
commit 4468e67fa0
1 changed files with 10 additions and 3 deletions

View File

@ -1271,9 +1271,16 @@ ecore_x_cursor_new(Ecore_X_Window win, int *pixels, int w, int h, int hot_x, int
((r - br) * (r - br)) +
((g - bg) * (g - bg)) +
((b - bb) * (b - bb));
v = (((d2 * 255) / (d1 + d2)) * 5) / 256;
if (v > dither[x & 0x1][y & 0x1]) v = 1;
else v = 0;
if (d1 + d2)
{
v = (((d2 * 255) / (d1 + d2)) * 5) / 256;
if (v > dither[x & 0x1][y & 0x1]) v = 1;
else v = 0;
}
else
{
v = 0;
}
XPutPixel(xim, x, y, v);
pix++;
}