aboutsummaryrefslogtreecommitdiff
path: root/src/render_helpers/shaders/border.frag
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-06-18 12:19:23 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-06-18 14:01:34 +0300
commit66202992c9536c0e01395813f9a611aa111e5ded (patch)
treef76155ad6b1c49c7d409db776441d4cf4ae25f15 /src/render_helpers/shaders/border.frag
parenteb59b10050d5806dd6dd42cfb9e93e1b65a24d4f (diff)
downloadniri-66202992c9536c0e01395813f9a611aa111e5ded.tar.gz
niri-66202992c9536c0e01395813f9a611aa111e5ded.tar.bz2
niri-66202992c9536c0e01395813f9a611aa111e5ded.zip
Fix blurry rounded corners on high scales
Diffstat (limited to 'src/render_helpers/shaders/border.frag')
-rw-r--r--src/render_helpers/shaders/border.frag4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/render_helpers/shaders/border.frag b/src/render_helpers/shaders/border.frag
index adbc124b..fe121037 100644
--- a/src/render_helpers/shaders/border.frag
+++ b/src/render_helpers/shaders/border.frag
@@ -5,6 +5,7 @@ uniform float niri_tint;
#endif
uniform float niri_alpha;
+uniform float niri_scale;
uniform vec2 niri_size;
varying vec2 niri_v_coords;
@@ -56,7 +57,8 @@ float rounding_alpha(vec2 coords, vec2 size, vec4 corner_radius) {
}
float dist = distance(coords, center);
- return 1.0 - smoothstep(radius - 0.5, radius + 0.5, dist);
+ float half_px = 0.5 / niri_scale;
+ return 1.0 - smoothstep(radius - half_px, radius + half_px, dist);
}
void main() {