new backend: assert blur_opacity is in [0, 1]

Related to: #314 #318

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2020-04-04 15:55:30 +01:00
parent 0e158c508f
commit a23bac727c
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
2 changed files with 2 additions and 1 deletions

View File

@ -215,6 +215,7 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) {
blur_opacity = blur_opacity =
w->opacity / win_calc_opacity_target(ps, w, true); w->opacity / win_calc_opacity_target(ps, w, true);
} }
assert(blur_opacity >= 0 && blur_opacity <= 1);
if (real_win_mode == WMODE_TRANS || ps->o.force_win_blend) { if (real_win_mode == WMODE_TRANS || ps->o.force_win_blend) {
// We need to blur the bounding shape of the window // We need to blur the bounding shape of the window

View File

@ -11,10 +11,10 @@
#include "atom.h" #include "atom.h"
#include "common.h" #include "common.h"
#include "compiler.h" #include "compiler.h"
#include "picom.h"
#include "config.h" #include "config.h"
#include "event.h" #include "event.h"
#include "log.h" #include "log.h"
#include "picom.h"
#include "region.h" #include "region.h"
#include "utils.h" #include "utils.h"
#include "win.h" #include "win.h"