HostDisplay: Fix 1x1 1:1 AR screenshots in OpenGL

This commit is contained in:
Connor McLaughlin 2020-04-11 00:56:28 +10:00
parent 05e4e7d262
commit 6d55979dac

View file

@ -169,7 +169,7 @@ bool HostDisplay::WriteDisplayTextureToFile(const char* filename, bool full_reso
}
else
{
resize_height = m_display_texture_view_height;
resize_height = std::abs(m_display_texture_view_height);
resize_width = static_cast<s32>(static_cast<float>(resize_height) * m_display_pixel_aspect_ratio);
}
}
@ -183,7 +183,7 @@ bool HostDisplay::WriteDisplayTextureToFile(const char* filename, bool full_reso
{
const auto [left, top, right, bottom] = CalculateDrawRect();
const float ratio =
static_cast<float>(m_display_texture_view_width) / static_cast<float>(m_display_texture_view_height);
static_cast<float>(m_display_texture_view_width) / static_cast<float>(std::abs(m_display_texture_view_height));
if (ratio > 1.0f)
{
resize_width = right - left;