vbe: Properly handle a value of 0 for THEME_MARGIN_GRADIENT

This commit is contained in:
mintsuki 2020-10-01 01:31:18 +02:00
parent 333270a392
commit 2a084c4756
2 changed files with 5 additions and 2 deletions

Binary file not shown.

View File

@ -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;