From e1730b4c843c075613bea49acef498f220542b1a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 18 Jul 2024 08:38:15 +0530 Subject: [PATCH] Use more comprehensive linear test for bezier curves --- kitty/animation.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kitty/animation.c b/kitty/animation.c index 303534954..d5bb1487c 100644 --- a/kitty/animation.c +++ b/kitty/animation.c @@ -196,12 +196,8 @@ init_function(Animation *a, double y_at_start, double y_at_end, easing_curve cur static bool is_bezier_linear(double p1x, double p1y, double p2x, double p2y) { - return ( - (p1x == 0 && p1y == 0 && p2x == 1 && p2y == 1) || - (p1x == 0 && p1y == 0 && p2x == 0 && p2y == 0) || - (p1x == 1 && p1y == 1 && p2x == 1 && p2y == 1) || - (p1x != 0 && p2x != 0 && p1y != 0 && p2y != 0 && p1y / p1x == p2y / p2x) - ); + // Is linear if all four points are on the same line. P0 and P4 are fixed at (0, 0) and (1, 1) for us. + return p1x == p1y && p2x == p2y; } void