1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

exiting early on error definitely sanitises indenting here

This commit is contained in:
Phil Sutter 2009-06-20 01:14:57 +02:00
parent 11d5286a40
commit 98e6f41bfa

View File

@ -150,13 +150,24 @@ void cimlib_add_image(const char *args)
}
}
static void cimlib_draw_image(struct image_list_s *cur, int *clip_x, int *clip_y, int *clip_x2, int *clip_y2)
static void
cimlib_draw_image(struct image_list_s *cur, int *clip_x,
int *clip_y, int *clip_x2, int *clip_y2)
{
image = imlib_load_image(cur->name);
if (image) {
int w, h;
time_t now = time(NULL);
DBGP("Drawing image '%s' at (%i,%i) scaled to %ix%i, caching interval set to %i (with -n opt %i)", cur->name, cur->x, cur->y, cur->w, cur->h, cur->flush_interval, cur->no_cache);
image = imlib_load_image(cur->name);
if (!image) {
ERR("Unable to load image '%s'", cur->name);
return;
}
DBGP("Drawing image '%s' at (%i,%i) scaled to %ix%i, "
"caching interval set to %i (with -n opt %i)",
cur->name, cur->x, cur->y, cur->w, cur->h,
cur->flush_interval, cur->no_cache);
imlib_context_set_image(image);
/* turn alpha channel on */
imlib_image_set_has_alpha(1);
@ -170,7 +181,8 @@ static void cimlib_draw_image(struct image_list_s *cur, int *clip_x, int *clip_y
imlib_blend_image_onto_image(image, 1, 0, 0, w, h,
cur->x, cur->y, cur->w, cur->h);
imlib_context_set_image(image);
if (cur->no_cache || (cur->flush_interval && now % cur->flush_interval == 0)) {
if (cur->no_cache || (cur->flush_interval &&
now % cur->flush_interval == 0)) {
imlib_free_image_and_decache();
} else {
imlib_free_image();
@ -179,9 +191,6 @@ static void cimlib_draw_image(struct image_list_s *cur, int *clip_x, int *clip_y
if (cur->y < *clip_y) *clip_y = cur->y;
if (cur->x + cur->w > *clip_x2) *clip_x2 = cur->x + cur->w;
if (cur->y + cur->h > *clip_y2) *clip_y2 = cur->y + cur->h;
} else {
ERR("Unable to load image '%s'", cur->name);
}
}
static void cimlib_draw_all(int *clip_x, int *clip_y, int *clip_x2, int *clip_y2)