Skip to content

Commit b655829

Browse files
committed
Draw fish eye with the new path filler function
1 parent e579877 commit b655829

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kitty/decorations.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,12 +933,15 @@ static void
933933
draw_fish_eye(Canvas *self, uint level UNUSED) {
934934
double x = self->width / 2., y = self->height / 2.;
935935
double radius = fmin(x, y);
936+
uint leftover = minus(self->height, 2*(uint)ceil(radius)) / 2;
936937
double central_radius = (2./3.) * radius;
937938
fill_circle_of_radius(self, x, y, central_radius, 255);
938939
double line_width = fmax(1. * self->supersample_factor, (radius - central_radius) / 2.5);
939940
radius = fmax(0, fmin(x, y) - line_width / 2.);
940941
Circle c = circle(x, y, radius, 0, 360);
941-
draw_parametrized_curve_with_derivative(self, &c, line_width, circle_x, circle_y, circle_prime_x, circle_prime_y);
942+
ClipRect cr = {.top=leftover, .y_end=self->height - leftover, .x_end=self->width};
943+
draw_parametrized_curve_with_derivative_and_antialiasing(
944+
self, &c, line_width, circle_x, circle_y, circle_prime_x, circle_prime_y, 0, 0, &cr);
942945
}
943946

944947
static void

0 commit comments

Comments
 (0)