1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58: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);
/* top */
if (tw > 0) {
tmp = RSmoothScaleImage(images[1], tw, images[1]->height);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[0]->width, 0);
RReleaseImage(tmp);
}
tmp = RSmoothScaleImage(images[1], tw, images[1]->height);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[0]->width, 0);
RReleaseImage(tmp);
/* bottom */
if (tw > 0) {
tmp = RSmoothScaleImage(images[7], tw, images[7]->height);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[6]->width, height - images[6]->height);
RReleaseImage(tmp);
}
tmp = RSmoothScaleImage(images[7], tw, images[7]->height);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[6]->width, height - images[6]->height);
RReleaseImage(tmp);
/* left */
if (th > 0) {
tmp = RSmoothScaleImage(images[3], images[3]->width, th);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, 0, images[0]->height);
RReleaseImage(tmp);
}
tmp = RSmoothScaleImage(images[3], images[3]->width, th);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, 0, images[0]->height);
RReleaseImage(tmp);
/* right */
if (th > 0) {
tmp = RSmoothScaleImage(images[5], images[5]->width, th);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, width - images[5]->width, images[2]->height);
RReleaseImage(tmp);
}
tmp = RSmoothScaleImage(images[5], images[5]->width, th);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, width - images[5]->width, images[2]->height);
RReleaseImage(tmp);
/* center */
if (tw > 0 && th > 0) {
tmp = RSmoothScaleImage(images[4], tw, th);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[0]->width, images[0]->height);
RReleaseImage(tmp);
}
tmp = RSmoothScaleImage(images[4], tw, th);
RCopyArea(img, tmp, 0, 0, tmp->width, tmp->height, images[0]->width, images[0]->height);
RReleaseImage(tmp);
/* corners */
RCopyArea(img, images[0], 0, 0, images[0]->width, images[0]->height, 0, 0);