mirror of
https://github.com/yshui/picom.git
synced 2024-11-11 13:51:02 -05:00
backend: gl: don't fill window with big border_width
If a window's border_width is bigger than its corner_radius, the inner radius of the border become less than 0, causing the entire window to be filled. Fixes #778 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
01649b68b9
commit
ea2ba58efd
1 changed files with 5 additions and 1 deletions
|
@ -395,7 +395,11 @@ static void _gl_compose(backend_t *base, struct backend_image *img, GLuint targe
|
|||
glUniform1f(gd->win_shader.uniform_corner_radius, (float)img->corner_radius);
|
||||
}
|
||||
if (gd->win_shader.uniform_border_width >= 0) {
|
||||
glUniform1f(gd->win_shader.uniform_border_width, (float)img->border_width);
|
||||
auto border_width = img->border_width;
|
||||
if (border_width > img->corner_radius) {
|
||||
border_width = 0;
|
||||
}
|
||||
glUniform1f(gd->win_shader.uniform_border_width, (float)border_width);
|
||||
}
|
||||
|
||||
// log_trace("Draw: %d, %d, %d, %d -> %d, %d (%d, %d) z %d\n",
|
||||
|
|
Loading…
Reference in a new issue