mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 19:12:17 +00:00
Fix faint toolbar icons on Wayland (#13723)
Use glBlendFuncSeparate in GLTexture::render_sub_texture so destination alpha stays at 1.0. The Wayland compositor honors framebuffer alpha for window compositing; the previous straight-alpha blend reduced dst alpha at anti-aliased icon edges, making them semi-transparent against the desktop. RGB blending is unchanged, so X11/Windows/macOS are unaffected.
This commit is contained in:
@@ -663,7 +663,9 @@ void GLTexture::render_texture(unsigned int tex_id, float left, float right, flo
|
||||
void GLTexture::render_sub_texture(unsigned int tex_id, float left, float right, float bottom, float top, const GLTexture::Quad_UVs& uvs)
|
||||
{
|
||||
glsafe(::glEnable(GL_BLEND));
|
||||
glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
|
||||
// Orca: fix washed-out toolbar icons on Wayland: keep destination alpha at 1.0 so the compositor
|
||||
// does not treat anti-aliased icon edges as window transparency.
|
||||
glsafe(::glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
|
||||
|
||||
glsafe(::glEnable(GL_TEXTURE_2D));
|
||||
glsafe(::glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE));
|
||||
|
||||
Reference in New Issue
Block a user