Clarify variable name

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-03-22 15:27:48 +01:00
parent 123b7c55f6
commit f330fdb6a7
2 changed files with 3 additions and 4 deletions

View file

@ -36,8 +36,8 @@ fragment float4 quad_fragment(
) { ) {
float2 half_size = input.quad.size / 2.; float2 half_size = input.quad.size / 2.;
float2 center = input.quad.origin + half_size; float2 center = input.quad.origin + half_size;
float2 center_to_point = abs(input.position.xy - center) - half_size + input.quad.corner_radius; float2 edge_to_point = abs(input.position.xy - center) - half_size + input.quad.corner_radius;
float distance = length(max(0.0, center_to_point)) + min(0.0, max(center_to_point.x, center_to_point.y)) - input.quad.corner_radius; float distance = length(max(0.0, edge_to_point)) + min(0.0, max(edge_to_point.x, edge_to_point.y)) - input.quad.corner_radius;
float4 coverage = float4(1.0, 1.0, 1.0, saturate(0.5 - distance)); float4 coverage = float4(1.0, 1.0, 1.0, saturate(0.5 - distance));
return coverage * coloru_to_colorf(input.quad.background_color); return coverage * coloru_to_colorf(input.quad.background_color);

View file

@ -69,8 +69,7 @@ impl View for FileFinder {
.with_margin_top(12.0) .with_margin_top(12.0)
.with_uniform_padding(6.0) .with_uniform_padding(6.0)
.with_corner_radius(6.0) .with_corner_radius(6.0)
.with_background_color(ColorU::new(0xff, 0xf2, 0xf2, 0xff)) .with_background_color(ColorU::new(0xf2, 0xf2, 0xf2, 0xff))
// .with_background_color(ColorU::new(0xf2, 0xf2, 0xf2, 0xff))
.with_shadow( .with_shadow(
vec2f(0.0, 4.0), vec2f(0.0, 4.0),
12.0, 12.0,