From 60b65d182ae21da090b4037a51bb597aac4d97bf Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 11 Dec 2009 09:57:54 +0000 Subject: [PATCH] Make sure we fully clip the first point before starting to adjust the second point. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404286 --- src/video/SDL_rect.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/video/SDL_rect.c b/src/video/SDL_rect.c index 52948f079..30c1e0f3c 100644 --- a/src/video/SDL_rect.c +++ b/src/video/SDL_rect.c @@ -311,9 +311,7 @@ SDL_IntersectRectAndLine(const SDL_Rect * rect, int *X1, int *Y1, int *X2, x1 = x; y1 = y; outcode1 = ComputeOutCode(rect, x, y); - } - - if (outcode2) { + } else { if (outcode2 & CODE_TOP) { y = recty1; x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1);