Merge pull request #11889 from Filoppi/patch-18

Fix video output having small black borders all the times
This commit is contained in:
Admiral H. Curtiss 2023-06-16 17:59:51 +02:00 committed by GitHub
commit cbcf5bfac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -440,8 +440,11 @@ void Presenter::UpdateDrawRectangle()
} }
// ensure divisibility by 4 to make it compatible with all the video encoders // ensure divisibility by 4 to make it compatible with all the video encoders
if (g_frame_dumper->IsFrameDumping())
{
draw_width = std::ceil(draw_width) - static_cast<int>(std::ceil(draw_width)) % 4; draw_width = std::ceil(draw_width) - static_cast<int>(std::ceil(draw_width)) % 4;
draw_height = std::ceil(draw_height) - static_cast<int>(std::ceil(draw_height)) % 4; draw_height = std::ceil(draw_height) - static_cast<int>(std::ceil(draw_height)) % 4;
}
m_target_rectangle.left = static_cast<int>(std::round(win_width / 2.0 - draw_width / 2.0)); m_target_rectangle.left = static_cast<int>(std::round(win_width / 2.0 - draw_width / 2.0));
m_target_rectangle.top = static_cast<int>(std::round(win_height / 2.0 - draw_height / 2.0)); m_target_rectangle.top = static_cast<int>(std::round(win_height / 2.0 - draw_height / 2.0));