Skip to content

Commit e579877

Browse files
committed
Fix ends of rounded separators slightly cut off at top and bottom
1 parent 8b8918e commit e579877

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

kitty/decorations.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,13 @@ draw_parametrized_curve_with_derivative(
858858
static void
859859
rounded_separator(Canvas *self, uint level, bool left) {
860860
uint gap = thickness(self, level, true);
861-
int c1x = find_bezier_for_D(minus(self->width, gap), self->height);
862-
CubicBezier cb = {.end={.y=self->height - 1}, .c1={.x=c1x}, .c2={.x=c1x, .y=self->height - 1}};
861+
int c1x = find_bezier_for_D(minus(self->width, gap), minus(self->height, gap));
862+
uint half_gap = gap / 2;
863+
CubicBezier cb = {.end={.y=minus(self->height, 1 + half_gap)}, .c1={.x=c1x},
864+
.c2={.x=c1x, .y=minus(self->height, 1 + half_gap)}};
863865
double line_width = thickness_as_float(self, level, true);
864-
#define d draw_parametrized_curve_with_derivative(self, &cb, line_width, bezier_x, bezier_y, bezier_prime_x, bezier_prime_y)
866+
#define d draw_parametrized_curve_with_derivative_and_antialiasing(\
867+
self, &cb, line_width, bezier_x, bezier_y, bezier_prime_x, bezier_prime_y, 0, half_gap, NULL)
865868
if (left) { d; } else { mirror_horizontally(d); }
866869
#undef d
867870
}
@@ -1665,8 +1668,8 @@ START_ALLOW_CASE_RANGE
16651668
S(L'◗', filled_D, true);
16661669
S(L'', filled_D, false);
16671670
S(L'◖', filled_D, false);
1668-
S(L'', rounded_separator, 1, true);
1669-
S(L'', rounded_separator, 1, false);
1671+
C(L'', rounded_separator, 1, true);
1672+
C(L'', rounded_separator, 1, false);
16701673

16711674
S(L'', cross_line, 1, true);
16721675
S(L'', cross_line, 1, true);

0 commit comments

Comments
 (0)