Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Make sure we fully clip the first point before starting to adjust the…
Browse files Browse the repository at this point in the history
… second point.
  • Loading branch information
slouken committed Dec 11, 2009
1 parent 678acaa commit 494bf8e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/video/SDL_rect.c
Expand Up @@ -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);
Expand Down

0 comments on commit 494bf8e

Please sign in to comment.