shell/elements: Fix corners order for clipping/shadows
This commit is contained in:
parent
ea470f0a4b
commit
b6f0855a31
5 changed files with 34 additions and 28 deletions
|
|
@ -30,17 +30,17 @@ float rounding_alpha(vec2 coords, vec2 size) {
|
|||
vec2 center;
|
||||
float radius;
|
||||
|
||||
if (coords.x < corner_radius.w && coords.y < corner_radius.w) {
|
||||
radius = corner_radius.w;
|
||||
if (coords.x < corner_radius.x && coords.y < corner_radius.x) {
|
||||
radius = corner_radius.x;
|
||||
center = vec2(radius, radius);
|
||||
} else if (size.x - corner_radius.y < coords.x && coords.y < corner_radius.y) {
|
||||
radius = corner_radius.y;
|
||||
center = vec2(size.x - radius, radius);
|
||||
} else if (size.x - corner_radius.x < coords.x && size.y - corner_radius.x < coords.y) {
|
||||
radius = corner_radius.x;
|
||||
center = vec2(size.x - radius, size.y - radius);
|
||||
} else if (coords.x < corner_radius.z && size.y - corner_radius.z < coords.y) {
|
||||
} else if (size.x - corner_radius.z < coords.x && size.y - corner_radius.z < coords.y) {
|
||||
radius = corner_radius.z;
|
||||
center = vec2(size.x - radius, size.y - radius);
|
||||
} else if (coords.x < corner_radius.w && size.y - corner_radius.w < coords.y) {
|
||||
radius = corner_radius.w;
|
||||
center = vec2(radius, size.y - radius);
|
||||
} else {
|
||||
return 1.0;
|
||||
|
|
|
|||
|
|
@ -74,17 +74,17 @@ float rounding_alpha(vec2 coords, vec2 size, vec4 corner_radius) {
|
|||
vec2 center;
|
||||
float radius;
|
||||
|
||||
if (coords.x < corner_radius.w && coords.y < corner_radius.w) {
|
||||
radius = corner_radius.w;
|
||||
if (coords.x < corner_radius.x && coords.y < corner_radius.x) {
|
||||
radius = corner_radius.x;
|
||||
center = vec2(radius, radius);
|
||||
} else if (size.x - corner_radius.y < coords.x && coords.y < corner_radius.y) {
|
||||
radius = corner_radius.y;
|
||||
center = vec2(size.x - radius, radius);
|
||||
} else if (size.x - corner_radius.x < coords.x && size.y - corner_radius.x < coords.y) {
|
||||
radius = corner_radius.x;
|
||||
center = vec2(size.x - radius, size.y - radius);
|
||||
} else if (coords.x < corner_radius.z && size.y - corner_radius.z < coords.y) {
|
||||
} else if (size.x - corner_radius.z < coords.x && size.y - corner_radius.z < coords.y) {
|
||||
radius = corner_radius.z;
|
||||
center = vec2(size.x - radius, size.y - radius);
|
||||
} else if (coords.x < corner_radius.w && size.y - corner_radius.w < coords.y) {
|
||||
radius = corner_radius.w;
|
||||
center = vec2(radius, size.y - radius);
|
||||
} else {
|
||||
return 1.0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue