From 6d55979dac755465f5127abf630c68ee2476ab86 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 11 Apr 2020 00:56:28 +1000 Subject: [PATCH] HostDisplay: Fix 1x1 1:1 AR screenshots in OpenGL --- src/core/host_display.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/host_display.cpp b/src/core/host_display.cpp index 494e7ea4d..2d87f722c 100644 --- a/src/core/host_display.cpp +++ b/src/core/host_display.cpp @@ -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(static_cast(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(m_display_texture_view_width) / static_cast(m_display_texture_view_height); + static_cast(m_display_texture_view_width) / static_cast(std::abs(m_display_texture_view_height)); if (ratio > 1.0f) { resize_width = right - left;