diff options
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/image.c b/src/image.c index d9ee5fa..7452e8c 100644 --- a/src/image.c +++ b/src/image.c @@ -6,16 +6,19 @@ -// Draw an image at a specific point +/* Draw an image at a specific point */ +/* TODO: require extent struct as function argument, so both position and size + * needs to be declared. */ int draw_image(cairo_t *c, char *path, double x, double y) { cairo_surface_t *image; - // Checks if the file exists. If it doesn't, warn the user that it was not found. - // A file not existing will not terminate the program, but simply not render the image. + /* Checks if the file exists. If it doesn't, warn the user that it was not + * found. A file not existing will not terminate the program, but simply not + * render the image. */ FILE *file; if((file = fopen(path, "r")) != NULL) { - // file exists + /* file exists */ fclose(file); } else @@ -33,7 +36,7 @@ int draw_image(cairo_t *c, char *path, double x, double y) { double fake_height = 100; double width_scale = fake_width / width; - double height_scale = fake_height / height; + double height_scle = fake_height / height; cairo_scale(c, width_scale, height_scale); @@ -48,11 +51,11 @@ int draw_image(cairo_t *c, char *path, double x, double y) { -// Draw month art +/* Draw month art */ int draw_month_art(cairo_t *c, struct dimensions *d, struct extents *he, struct alignment *pl, char *path) { cairo_save(c); double width = he->width; - // TODO: Make this relative to text height + /* TODO: Make this relative to text height. */ double height = he->height - (pl->margin * 3.0); double cursor_x = pl->margin; @@ -64,5 +67,3 @@ int draw_month_art(cairo_t *c, struct dimensions *d, struct extents *he, struct cairo_restore(c); return 0; } - - |
