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

@@ -119,9 +119,11 @@ RCreateImageFromXImage(RContext *context, XImage *image, XImage *mask)
}
}
#define MIN(a,b) ((a)<(b)?(a):(b))
if (mask) {
for (y = 0; y < mask->height; y++) {
for (x = 0; x < mask->width; x++) {
for (y = 0; y < MIN(mask->height, image->height); y++) {
for (x = 0; x < MIN(mask->width, image->width); x++) {
if (XGetPixel(mask, x, y)) {
*(data++) = 0xff;
} else {