vulkan: Don't round corners when growing rounded rect

If the corner is set to 0, keep it there.
This commit is contained in:
Benjamin Otte 2023-05-07 03:40:44 +02:00
parent 1be21a33d9
commit 3d1a607367

View File

@ -46,8 +46,8 @@ RoundedRect
rounded_rect_shrink (RoundedRect r, vec4 amount)
{
vec4 new_bounds = r.bounds + vec4(1.0,1.0,-1.0,-1.0) * amount.wxyz;
vec4 new_widths = max (r.corner_widths - amount.wyyw, 0.0);
vec4 new_heights = max (r.corner_heights - amount.xxzz, 0.0);
vec4 new_widths = max (r.corner_widths - sign (r.corner_widths) * amount.wyyw, 0.0);
vec4 new_heights = max (r.corner_heights - sign (r.corner_heights) * amount.xxzz, 0.0);
return RoundedRect (new_bounds, new_widths, new_heights);
}