Skip to content

Commit 727b492

Browse files
committed
Update the viewport when logical presentation changes
Fixes #13256
1 parent de6a230 commit 727b492

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/render/SDL_render.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,6 +2743,8 @@ static void UpdateLogicalPresentation(SDL_Renderer *renderer)
27432743
view->pixel_h = (int) view->logical_dst_rect.h;
27442744
UpdatePixelViewport(renderer, view);
27452745
UpdatePixelClipRect(renderer, view);
2746+
QueueCmdSetViewport(renderer);
2747+
QueueCmdSetClipRect(renderer);
27462748
}
27472749

27482750
bool SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode)
@@ -3663,7 +3665,7 @@ bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count
36633665
#endif
36643666

36653667
SDL_RenderViewState *view = renderer->view;
3666-
const bool islogical = ((view == &renderer->main_view) && (view->logical_presentation_mode != SDL_LOGICAL_PRESENTATION_DISABLED));
3668+
const bool islogical = (view->logical_presentation_mode != SDL_LOGICAL_PRESENTATION_DISABLED);
36673669

36683670
if (islogical || (renderer->line_method == SDL_RENDERLINEMETHOD_GEOMETRY)) {
36693671
const float scale_x = view->current_scale.x;
@@ -3682,7 +3684,7 @@ bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count
36823684
int num_indices = 0;
36833685
const int size_indices = 4;
36843686
int cur_index = -4;
3685-
const int is_looping = (points[0].x == points[count - 1].x && points[0].y == points[count - 1].y);
3687+
const bool is_looping = (points[0].x == points[count - 1].x && points[0].y == points[count - 1].y);
36863688
SDL_FPoint p; // previous point
36873689
p.x = p.y = 0.0f;
36883690
/* p q
@@ -3714,7 +3716,7 @@ bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count
37143716
num_indices += 3;
37153717

37163718
// closed polyline, don´t draw twice the point
3717-
if (i || is_looping == 0) {
3719+
if (i || !is_looping) {
37183720
ADD_TRIANGLE(4, 5, 6)
37193721
ADD_TRIANGLE(4, 6, 7)
37203722
}

0 commit comments

Comments
 (0)