Fixed Cohen-Sutherland out code computation for float line intersection

Fixes https://github.com/libsdl-org/SDL/issues/10866
This commit is contained in:
Sam Lantinga committed 2024-10-13 13:04:59 -07:00
1 parent db78c0f563
commit d7be7fc168
2 files changed
+13 -2

No files matched your search

+2 -2
View File
@@ -297,12 +297,12 @@ static int COMPUTEOUTCODE(const RECTTYPE *rect, SCALARTYPE x, SCALARTYPE y)
int code = 0;
if (y < rect->y) {
code |= CODE_TOP;
} else if (y >= rect->y + rect->h) {
} else if (y > (rect->y + rect->h - ENCLOSEPOINTS_EPSILON)) {
code |= CODE_BOTTOM;
}
if (x < rect->x) {
code |= CODE_LEFT;
} else if (x >= rect->x + rect->w) {
} else if (x > (rect->x + rect->w - ENCLOSEPOINTS_EPSILON)) {
code |= CODE_RIGHT;
}
return code;