From b0f64a61699febd4721f728cd7b474a53526a656 Mon Sep 17 00:00:00 2001 From: Rio6 Date: Sun, 6 Jun 2021 20:17:42 -0400 Subject: [PATCH] fix --max and --fill not scaling image when the image has the same aspect ratio as the screen --- unlock_indicator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unlock_indicator.c b/unlock_indicator.c index 04d75b61..9fc07f05 100644 --- a/unlock_indicator.c +++ b/unlock_indicator.c @@ -1132,7 +1132,7 @@ void draw_image(uint32_t* root_resolution, cairo_surface_t *img, cairo_t* xcb_ct } else if (bg_type == MAX || bg_type == FILL) { double aspect_diff = (double) xr_resolutions[i].height / xr_resolutions[i].width - image_height / image_width; - if((bg_type == MAX && aspect_diff > 0) || (bg_type == FILL && aspect_diff < 0)) { + if((bg_type == MAX && aspect_diff >= 0) || (bg_type == FILL && aspect_diff <= 0)) { scale_x = scale_y = xr_resolutions[i].width / image_width; } else if ((bg_type == MAX && aspect_diff < 0) || (bg_type == FILL && aspect_diff > 0)) { scale_x = scale_y = xr_resolutions[i].height / image_height;