vulkan: Don't round corners when growing rounded rect
authorBenjamin Otte <otte@redhat.com>
Sun, 7 May 2023 01:40:44 +0000 (03:40 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 4 Jun 2023 17:42:00 +0000 (19:42 +0200)
If the corner is set to 0, keep it there.

gsk/vulkan/resources/rounded-rect.glsl

index 5ee5dfd2fac596b58427eaf16dc5fd5b11f5b0b3..38e8cad9411822fb6745d96b5faaa4c11448ecbe 100644 (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);
 }