gpui: Improve underline appearance (#17586)

This commit is contained in:
ensi 2024-09-18 16:32:37 +03:00 committed by GitHub
parent 3b153a54c2
commit 3ac201e448
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -488,8 +488,8 @@ fn fs_underline(input: UnderlineVarying) -> @location(0) vec4<f32> {
let half_thickness = underline.thickness * 0.5;
let st = (input.position.xy - underline.bounds.origin) / underline.bounds.size.y - vec2<f32>(0.0, 0.5);
let frequency = M_PI_F * 3.0 * underline.thickness / 8.0;
let amplitude = 1.0 / (2.0 * underline.thickness);
let frequency = M_PI_F * 3.0 * underline.thickness / 3.0;
let amplitude = 1.0 / (4.0 * underline.thickness);
let sine = sin(st.x * frequency) * amplitude;
let dSine = cos(st.x * frequency) * amplitude * frequency;
let distance = (st.y - sine) / sqrt(1.0 + dSine * dSine);