summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2009-12-12 00:08:45 +0000
committerSam Lantinga <slouken@libsdl.org>2009-12-12 00:08:45 +0000
commit9888012562570680f0224ad08322de26e7da487f (patch)
tree533c3649f8d1ac9d05cb15543ac11a200ff97039
parent0e0b96d72f8315b4fd58b7419ca87874c664cad1 (diff)
Allow points to be outside the window bounds, stress testing the clipping code.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404294
-rw-r--r--test/testdraw2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/testdraw2.c b/test/testdraw2.c
index 32577964..6a39c648 100644
--- a/test/testdraw2.c
+++ b/test/testdraw2.c
@@ -107,10 +107,10 @@ DrawLines(SDL_WindowID window)
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 @@ DrawRects(SDL_WindowID window)
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);