Fix #21565: Giant screenshots not working correctly

This commit is contained in:
Matt 2024-03-10 22:24:40 +02:00 committed by GitHub
parent 1981ca6b0b
commit 6950a74b37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -325,6 +325,8 @@ static Viewport GetGiantViewport(int32_t rotation, ZoomLevel zoom)
viewport.width = zoom.ApplyInversedTo(viewport.view_width);
viewport.height = zoom.ApplyInversedTo(viewport.view_height);
viewport.zoom = zoom;
viewport.rotation = rotation;
return viewport;
}
@ -498,7 +500,6 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti
auto zoom = ZoomLevel{ customZoom };
auto rotation = std::atoi(argv[4]) & 3;
viewport = GetGiantViewport(rotation, zoom);
viewport.rotation = rotation;
}
else
{
@ -650,14 +651,13 @@ void CaptureImage(const CaptureOptions& options)
viewport.viewPos = { coords2d.x - ((options.Zoom.ApplyTo(viewport.view_width)) / 2),
coords2d.y - ((options.Zoom.ApplyTo(viewport.view_height)) / 2) };
viewport.zoom = options.Zoom;
viewport.rotation = options.Rotation;
}
else
{
viewport = GetGiantViewport(options.Rotation, options.Zoom);
}
viewport.rotation = options.Rotation;
if (options.Transparent)
{
viewport.flags |= VIEWPORT_FLAG_TRANSPARENT_BACKGROUND;