# HG changeset patch # User Sam Lantinga # Date 1260576525 0 # Node ID 65848493e08eed94d9e10dfdf9abb9d66e377c41 # Parent 6d91cff0ec7922d25bc7951a9ac622cf9d75460c Allow points to be outside the window bounds, stress testing the clipping code. diff -r 6d91cff0ec79 -r 65848493e08e test/testdraw2.c --- a/test/testdraw2.c Sat Dec 12 00:08:02 2009 +0000 +++ b/test/testdraw2.c Sat Dec 12 00:08:45 2009 +0000 @@ -107,10 +107,10 @@ SDL_RenderLine(0, window_h / 2, window_w - 1, window_h / 2); SDL_RenderLine(window_w / 2, 0, window_w / 2, window_h - 1); } else { - x1 = rand() % window_w; - x2 = rand() % window_w; - y1 = rand() % window_h; - y2 = rand() % window_h; + x1 = (rand() % (window_w*2)) - window_w; + x2 = (rand() % (window_w*2)) - window_w; + y1 = (rand() % (window_h*2)) - window_h; + y2 = (rand() % (window_h*2)) - window_h; SDL_RenderLine(x1, y1, x2, y2); } } @@ -157,8 +157,8 @@ rect.w = rand() % (window_h / 2); rect.h = rand() % (window_h / 2); - rect.x = (rand() % window_w) - (rect.w / 2); - rect.y = (rand() % window_w) - (rect.h / 2); + rect.x = (rand() % (window_w*2) - window_w) - (rect.w / 2); + rect.y = (rand() % (window_h*2) - window_h) - (rect.h / 2); SDL_RenderRect(&rect); } SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE);