i3lock-color

The world's most popular non-default computer lockscreen.
Index Commits Files Refs README LICENSE
commit 3de6adbd38580d7bdbc7028d693d75152e860733
parent fc59f5bccef4235cc17046c9a074ce3a71a5b85e
Author: Raymond Li <hi@raymond.li>
Date:   Fri, 18 Jun 2021 00:09:18 -0400

Merge pull request #228 from Rio6/fix-fill-with-same-aspect

fix --max and --fill not scaling image when the image has the same aspect ratio as the screen
Diffstat:
Munlock_indicator.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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;