1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

fixed bug with RCreateImageFromXImage() with mask and image of != sizes

fixed dgradient rendering
This commit is contained in:
kojima
2000-01-19 21:25:03 +00:00
parent 0780ab82fe
commit 1e5a1d8c91
3 changed files with 9 additions and 6 deletions

View File

@@ -250,13 +250,13 @@ renderDGradient(unsigned width, unsigned height, int r0, int g0, int b0,
return NULL;
}
a = (((width - 1)<<16) / (height - 1))*3;
a = (((width - 1)<<16) / (height - 1));
width *= 3;
/* copy the first line to the other lines with corresponding offset */
for (i=0, j=0, offset = 0; i<height; i++, j+= width) {
offset += a;
memcpy(&(image->data[j]), &(tmp->data[(offset>>16)]), width);
memcpy(&(image->data[j]), &(tmp->data[(offset>>16)*3]), width);
}
RDestroyImage(tmp);
return image;