mirror of
https://github.com/yawut/SDL.git
synced 2026-08-23 09:15:18 -05:00
Make sure we fully clip the first point before starting to adjust the second point.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user