gpui: Improve underline appearance (#17586)
This commit is contained in:
parent
3b153a54c2
commit
3ac201e448
1 changed files with 2 additions and 2 deletions
|
@ -488,8 +488,8 @@ fn fs_underline(input: UnderlineVarying) -> @location(0) vec4<f32> {
|
||||||
|
|
||||||
let half_thickness = underline.thickness * 0.5;
|
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 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 frequency = M_PI_F * 3.0 * underline.thickness / 3.0;
|
||||||
let amplitude = 1.0 / (2.0 * underline.thickness);
|
let amplitude = 1.0 / (4.0 * underline.thickness);
|
||||||
let sine = sin(st.x * frequency) * amplitude;
|
let sine = sin(st.x * frequency) * amplitude;
|
||||||
let dSine = cos(st.x * frequency) * amplitude * frequency;
|
let dSine = cos(st.x * frequency) * amplitude * frequency;
|
||||||
let distance = (st.y - sine) / sqrt(1.0 + dSine * dSine);
|
let distance = (st.y - sine) / sqrt(1.0 + dSine * dSine);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue