mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 23:21:57 -07:00
Allow setting alpha value for ignorezero layer rule (#2477)
* rename ignorezero to ignorealpha * allow setting ignorealpha value This commit allows setting a float value (0-1) for the ignorealpha layer rule. Does not yet have error handling; invalid ignorealpha layer rule will crash Hyprland. * add brackets i forgot to add * prevent crash with invalid ignorealpha value prevents hyprland from immediately crashing with invalid ignorealpha layer rule does not log * don't try to set ignoreAlphaValue if alpha value not specified * add catch to try, reintroduce ignorezero - added catch after try cuz i was an idiot - re-add ignorezero as an alternative to ignorealpha to not introduce a breaking change * add logging for failed ignorealpha layer rule * fix get ignorealpha's get VALUE * check npos and use empty() * rename VALUE cuz no longer const * format Shader.hpp
This commit is contained in:
@@ -96,7 +96,8 @@ uniform vec2 fullSize;
|
||||
uniform float radius;
|
||||
|
||||
uniform int discardOpaque;
|
||||
uniform int discardAlphaZero;
|
||||
uniform int discardAlpha;
|
||||
uniform float discardAlphaValue;
|
||||
|
||||
uniform int applyTint;
|
||||
uniform vec3 tint;
|
||||
@@ -110,7 +111,7 @@ void main() {
|
||||
if (discardOpaque == 1 && pixColor[3] * alpha == 1.0)
|
||||
discard;
|
||||
|
||||
if (discardAlphaZero == 1 && pixColor[3] == 0.0)
|
||||
if (discardAlpha == 1 && pixColor[3] <= discardAlphaValue)
|
||||
discard;
|
||||
|
||||
if (applyTint == 1) {
|
||||
@@ -145,7 +146,8 @@ uniform vec2 fullSize;
|
||||
uniform float radius;
|
||||
|
||||
uniform int discardOpaque;
|
||||
uniform int discardAlphaZero;
|
||||
uniform int discardAlpha;
|
||||
uniform int discardAlphaValue;
|
||||
|
||||
uniform int applyTint;
|
||||
uniform vec3 tint;
|
||||
@@ -232,7 +234,8 @@ uniform vec2 fullSize;
|
||||
uniform float radius;
|
||||
|
||||
uniform int discardOpaque;
|
||||
uniform int discardAlphaZero;
|
||||
uniform int discardAlpha;
|
||||
uniform int discardAlphaValue;
|
||||
|
||||
uniform int applyTint;
|
||||
uniform vec3 tint;
|
||||
|
Reference in New Issue
Block a user