comparison src/video/SDL_rect.c @ 3542:97eae5a705f9

Make sure we fully clip the first point before starting to adjust the second point.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 11 Dec 2009 09:57:54 +0000
parents 0c429a5fda8a
children f7b03b6838cb
comparison
equal deleted inserted replaced
3541:0c429a5fda8a 3542:97eae5a705f9
309 y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1); 309 y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1);
310 } 310 }
311 x1 = x; 311 x1 = x;
312 y1 = y; 312 y1 = y;
313 outcode1 = ComputeOutCode(rect, x, y); 313 outcode1 = ComputeOutCode(rect, x, y);
314 } 314 } else {
315
316 if (outcode2) {
317 if (outcode2 & CODE_TOP) { 315 if (outcode2 & CODE_TOP) {
318 y = recty1; 316 y = recty1;
319 x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); 317 x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1);
320 } else if (outcode2 & CODE_BOTTOM) { 318 } else if (outcode2 & CODE_BOTTOM) {
321 y = recty2; 319 y = recty2;