Limit border radius to max dimension in quad pipeline
This commit is contained in:
parent
f41eacc3dc
commit
1916755b6b
3 changed files with 10 additions and 0 deletions
|
|
@ -29,6 +29,11 @@ void main() {
|
||||||
vec2 p_Pos = i_Pos * u_Scale;
|
vec2 p_Pos = i_Pos * u_Scale;
|
||||||
vec2 p_Scale = i_Scale * u_Scale;
|
vec2 p_Scale = i_Scale * u_Scale;
|
||||||
|
|
||||||
|
float i_BorderRadius = min(
|
||||||
|
i_BorderRadius,
|
||||||
|
min(i_Scale.x, i_Scale.y) / 2.0
|
||||||
|
);
|
||||||
|
|
||||||
mat4 i_Transform = mat4(
|
mat4 i_Transform = mat4(
|
||||||
vec4(p_Scale.x + 1.0, 0.0, 0.0, 0.0),
|
vec4(p_Scale.x + 1.0, 0.0, 0.0, 0.0),
|
||||||
vec4(0.0, p_Scale.y + 1.0, 0.0, 0.0),
|
vec4(0.0, p_Scale.y + 1.0, 0.0, 0.0),
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,11 @@ void main() {
|
||||||
vec2 p_Pos = i_Pos * u_Scale;
|
vec2 p_Pos = i_Pos * u_Scale;
|
||||||
vec2 p_Scale = i_Scale * u_Scale;
|
vec2 p_Scale = i_Scale * u_Scale;
|
||||||
|
|
||||||
|
float i_BorderRadius = min(
|
||||||
|
i_BorderRadius,
|
||||||
|
min(i_Scale.x, i_Scale.y) / 2.0
|
||||||
|
);
|
||||||
|
|
||||||
mat4 i_Transform = mat4(
|
mat4 i_Transform = mat4(
|
||||||
vec4(p_Scale.x + 1.0, 0.0, 0.0, 0.0),
|
vec4(p_Scale.x + 1.0, 0.0, 0.0, 0.0),
|
||||||
vec4(0.0, p_Scale.y + 1.0, 0.0, 0.0),
|
vec4(0.0, p_Scale.y + 1.0, 0.0, 0.0),
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue