mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-20 20:22:10 +00:00
Use pre-multiplied alpha when clearing windows
Apparently most systems expect this. See https://github.com/glfw/glfw/issues/1538
This commit is contained in:
parent
33c5fc0fb6
commit
2f0b6e24c9
1 changed files with 4 additions and 3 deletions
|
|
@ -477,10 +477,11 @@ set_cell_uniforms(float current_inactive_text_alpha, bool force) {
|
|||
|
||||
void
|
||||
blank_canvas(float background_opacity, color_type color) {
|
||||
#define C(shift) (((GLfloat)((color >> shift) & 0xFF)) / 255.0f)
|
||||
glClearColor(C(16), C(8), C(0), background_opacity);
|
||||
// See https://github.com/glfw/glfw/issues/1538 for why we use pre-multiplied alpha
|
||||
#define C(shift) ((((GLfloat)((color >> shift) & 0xFF)) / 255.0f) * background_opacity)
|
||||
glClearColor(C(16), C(8), C(0), background_opacity);
|
||||
#undef C
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue