comparison src/video/SDL_rect.c @ 3004:f3d7226a8dfd

Fixed lines intersecting the top corners of a rectangle
author Sam Lantinga <slouken@libsdl.org>
date Mon, 05 Jan 2009 07:07:48 +0000
parents e4f025078c1c
children 47965eacde88
comparison
equal deleted inserted replaced
3003:699d68ef2aca 3004:f3d7226a8dfd
148 return SDL_TRUE; 148 return SDL_TRUE;
149 } 149 }
150 150
151 /* Check to see if entire line is to one side of rect */ 151 /* Check to see if entire line is to one side of rect */
152 if ((x1 < rectx1 && x2 < rectx1) || (x1 > rectx2 && x2 > rectx2) || 152 if ((x1 < rectx1 && x2 < rectx1) || (x1 > rectx2 && x2 > rectx2) ||
153 (y1 < recty1 && y2 < recty2) || (y1 > recty2 && y2 > recty2)) { 153 (y1 < recty1 && y2 < recty1) || (y1 > recty2 && y2 > recty2)) {
154 return SDL_FALSE; 154 return SDL_FALSE;
155 } 155 }
156 156
157 if (y1 == y2) { 157 if (y1 == y2) {
158 /* Horizontal line, easy to clip */ 158 /* Horizontal line, easy to clip */