render: Fixed #108 active hint overlapping

This commit is contained in:
Victoria Brekenfeld 2023-05-25 21:36:44 +02:00
parent 2f6d4da712
commit bd7a4ca898
4 changed files with 19 additions and 10 deletions

View file

@ -15,12 +15,12 @@ float rounded_box(vec2 center, vec2 size, float radius) {
}
void main() {
vec2 center = size / 2.0 - vec2(0.5);
vec2 center = size / 2.0;
vec2 location = v_coords * size;
vec4 mix_color;
float distance = rounded_box(location - center, size / 2.0 - vec2(thickness / 2.0), radius);
float smoothedAlpha = 1.0 - smoothstep(0.0, 2.0, abs(distance) - (thickness / 2.0));
float smoothedAlpha = 1.0 - smoothstep(0.0, 1.0, abs(distance) - (thickness / 2.0));
mix_color = mix(vec4(0.0, 0.0, 0.0, 0.0), vec4(color, alpha), smoothedAlpha);