# HG changeset patch # User Sam Lantinga # Date 1260525474 0 # Node ID 97eae5a705f9947c50ae9a1ed67d51f8d12845fc # Parent 0c429a5fda8a13d9dc703c636e7e8ff686e9b0bc Make sure we fully clip the first point before starting to adjust the second point. diff -r 0c429a5fda8a -r 97eae5a705f9 src/video/SDL_rect.c --- a/src/video/SDL_rect.c Fri Dec 11 09:22:34 2009 +0000 +++ b/src/video/SDL_rect.c Fri Dec 11 09:57:54 2009 +0000 @@ -311,9 +311,7 @@ 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);