Fix duplicating fragment position
This commit is contained in:
parent
a70715ad9e
commit
0772310c4f
|
@ -80,8 +80,7 @@ fn distance_alg(
|
||||||
|
|
||||||
[[stage(fragment)]]
|
[[stage(fragment)]]
|
||||||
fn fs_main(
|
fn fs_main(
|
||||||
input: VertexOutput,
|
input: VertexOutput
|
||||||
[[builtin(position)]] coord: vec4<f32>
|
|
||||||
) -> [[location(0)]] vec4<f32> {
|
) -> [[location(0)]] vec4<f32> {
|
||||||
var mixed_color: vec4<f32> = input.color;
|
var mixed_color: vec4<f32> = input.color;
|
||||||
|
|
||||||
|
@ -92,7 +91,7 @@ fn fs_main(
|
||||||
);
|
);
|
||||||
|
|
||||||
var internal_distance: f32 = distance_alg(
|
var internal_distance: f32 = distance_alg(
|
||||||
vec2<f32>(coord.x, coord.y),
|
vec2<f32>(input.position.x, input.position.y),
|
||||||
input.pos + vec2<f32>(input.border_width, input.border_width),
|
input.pos + vec2<f32>(input.border_width, input.border_width),
|
||||||
input.scale - vec2<f32>(input.border_width * 2.0, input.border_width * 2.0),
|
input.scale - vec2<f32>(input.border_width * 2.0, input.border_width * 2.0),
|
||||||
internal_border
|
internal_border
|
||||||
|
@ -108,7 +107,7 @@ fn fs_main(
|
||||||
}
|
}
|
||||||
|
|
||||||
var dist: f32 = distance_alg(
|
var dist: f32 = distance_alg(
|
||||||
vec2<f32>(coord.x, coord.y),
|
vec2<f32>(input.position.x, input.position.y),
|
||||||
input.pos,
|
input.pos,
|
||||||
input.scale,
|
input.scale,
|
||||||
input.border_radius
|
input.border_radius
|
||||||
|
|
Loading…
Reference in New Issue