:: commit 2a084c47562f9b9ad59012ee2818fe732d2959e2

mintsuki <mintsuki@protonmail.com> — 2020-09-30 23:31

parents: 333270a392

vbe: Properly handle a value of 0 for THEME_MARGIN_GRADIENT

diff --git a/limine.bin b/limine.bin
index 7bb8c3ad..6054e27b 100644
Binary files a/limine.bin and b/limine.bin differ
diff --git a/stage2/drivers/vbe.c b/stage2/drivers/vbe.c
index b57148f5..8561a899 100644
--- a/stage2/drivers/vbe.c
+++ b/stage2/drivers/vbe.c
@@ -92,6 +92,11 @@ static uint32_t blend_gradient_from_box(int x, int y, uint32_t hex) {
         return hex;
     }
 
+    uint32_t bg_px = background->get_pixel(background, x, y);
+
+    if (margin_gradient == 0)
+        return bg_px;
+
     int distance, x_distance, y_distance;
 
     if (x < frame_width)
@@ -113,8 +118,6 @@ static uint32_t blend_gradient_from_box(int x, int y, uint32_t hex) {
                       + (uint64_t)y_distance * (uint64_t)y_distance);
     }
 
-    uint32_t bg_px = background->get_pixel(background, x, y);
-
     if (distance > margin_gradient)
         return bg_px;
 
tab: 248 wrap: offon