1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00

wmaker: remove checks on variables that have already been checked

In the function that creates the background image for the switch panel
there are a number of checks on the size of the image, but this has
already been checked at the beginning of the function with an early return
in this case.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-07-04 23:28:41 +02:00
committed by Carlos R. Mafra
parent 30c8c1c645
commit d31472773b

View File

@@ -261,35 +261,29 @@ static RImage *assemblePuzzleImage(RImage **images, int width, int height)
RFillImage(img, &color); RFillImage(img, &color);
/* top */ /* top */
if (tw > 0) { tmp = RSmoothScaleImage(images[1], tw, images[1]->height);
tmp = RSmoothScaleImage(images[1], tw, images[1]->height); RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[0]->width, 0);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[0]->width, 0); RReleaseImage(tmp);
RReleaseImage(tmp);
}
/* bottom */ /* bottom */
if (tw > 0) { tmp = RSmoothScaleImage(images[7], tw, images[7]->height);
tmp = RSmoothScaleImage(images[7], tw, images[7]->height); RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[6]->width, height - images[6]->height);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[6]->width, height - images[6]->height); RReleaseImage(tmp);
RReleaseImage(tmp);
}
/* left */ /* left */
if (th > 0) { tmp = RSmoothScaleImage(images[3], images[3]->width, th);
tmp = RSmoothScaleImage(images[3], images[3]->width, th); RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, 0, images[0]->height);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, 0, images[0]->height); RReleaseImage(tmp);
RReleaseImage(tmp);
}
/* right */ /* right */
if (th > 0) { tmp = RSmoothScaleImage(images[5], images[5]->width, th);
tmp = RSmoothScaleImage(images[5], images[5]->width, th); RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, width - images[5]->width, images[2]->height);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, width - images[5]->width, images[2]->height); RReleaseImage(tmp);
RReleaseImage(tmp);
}
/* center */ /* center */
if (tw > 0 && th > 0) { tmp = RSmoothScaleImage(images[4], tw, th);
tmp = RSmoothScaleImage(images[4], tw, th); RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[0]->width, images[0]->height);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[0]->width, images[0]->height); RReleaseImage(tmp);
RReleaseImage(tmp);
}
/* corners */ /* corners */
RCopyArea(img, images[0], 0, 0, images[0]->width, images[0]->height, 0, 0); RCopyArea(img, images[0], 0, 0, images[0]->width, images[0]->height, 0, 0);