Skip to content

Commit f61860f

Browse files
committed
testautomation: fixed incorrect test.
The test was doing this: - The output size is 80x60 - The logical size is 40x30 - The viewport is { 10, 7, 40, 30 } - Draw to fill this whole viewport. This would offset the filled rectangle a little, as before, but then the viewport was the size of the entire logical space, so it wasn't a rectangle centered in the middle of the output, as was expected. This used to produce the expected output before the fix in fa7a529. But it appears the test was incorrect, so this tweaks the viewport to produce the expected result.
1 parent 4bb3c2a commit f61860f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/testautomation_render.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,8 @@ static int SDLCALL render_testLogicalSize(void *arg)
11491149
CHECK_FUNC(SDL_SetRenderLogicalPresentation, (renderer, w / factor, h / factor, SDL_LOGICAL_PRESENTATION_LETTERBOX))
11501150
viewport.x = (TESTRENDER_SCREEN_W / 4) / factor;
11511151
viewport.y = (TESTRENDER_SCREEN_H / 4) / factor;
1152-
viewport.w = TESTRENDER_SCREEN_W / factor;
1153-
viewport.h = TESTRENDER_SCREEN_H / factor;
1152+
viewport.w = (TESTRENDER_SCREEN_W / 2) / factor;
1153+
viewport.h = (TESTRENDER_SCREEN_H / 2) / factor;
11541154
CHECK_FUNC(SDL_SetRenderViewport, (renderer, &viewport))
11551155
CHECK_FUNC(SDL_SetRenderDrawColor, (renderer, 0, 255, 0, SDL_ALPHA_OPAQUE))
11561156
CHECK_FUNC(SDL_RenderFillRect, (renderer, NULL))

0 commit comments

Comments
 (0)