wgpu: fix "radii" typo
This commit is contained in:
parent
e8b1e5a112
commit
5c2185f123
1 changed files with 7 additions and 7 deletions
|
|
@ -22,14 +22,14 @@ fn rounded_box_sdf(to_center: vec2<f32>, size: vec2<f32>, radius: f32) -> f32 {
|
||||||
return length(max(abs(to_center) - size + vec2<f32>(radius, radius), vec2<f32>(0.0, 0.0))) - radius;
|
return length(max(abs(to_center) - size + vec2<f32>(radius, radius), vec2<f32>(0.0, 0.0))) - radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Based on the fragment position and the center of the quad, select one of the 4 radi.
|
// Based on the fragment position and the center of the quad, select one of the 4 radii.
|
||||||
// Order matches CSS border radius attribute:
|
// Order matches CSS border radius attribute:
|
||||||
// radi.x = top-left, radi.y = top-right, radi.z = bottom-right, radi.w = bottom-left
|
// radii.x = top-left, radii.y = top-right, radii.z = bottom-right, radii.w = bottom-left
|
||||||
fn select_border_radius(radi: vec4<f32>, position: vec2<f32>, center: vec2<f32>) -> f32 {
|
fn select_border_radius(radii: vec4<f32>, position: vec2<f32>, center: vec2<f32>) -> f32 {
|
||||||
var rx = radi.x;
|
var rx = radii.x;
|
||||||
var ry = radi.y;
|
var ry = radii.y;
|
||||||
rx = select(radi.x, radi.y, position.x > center.x);
|
rx = select(radii.x, radii.y, position.x > center.x);
|
||||||
ry = select(radi.w, radi.z, position.x > center.x);
|
ry = select(radii.w, radii.z, position.x > center.x);
|
||||||
rx = select(rx, ry, position.y > center.y);
|
rx = select(rx, ry, position.y > center.y);
|
||||||
return rx;
|
return rx;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue