summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-04-03 00:55:52 +1000
committerStenzek <stenzek@gmail.com>2018-05-03 22:01:07 +1000
commit210a6a37b4e0dcba634f4d0d1630ffd345932cfd (patch)
treec52cf7b45486e3ecd45cc49f1879ae08323897ab /Source/Core/DolphinWX/FrameTools.cpp
parent467379c14924c9c63ea5175ab76598143f833e4c (diff)
DolphinWX: Scale window geometry before passing to backend
In macOS, the window size is device-independent points, which may not match the content/backing framebuffer size.
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index ddfda40ad5..c5695a95e8 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -614,7 +614,13 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event)
m_log_window->Update();
if (g_renderer)
- g_renderer->ResizeSurface(width, height);
+ {
+ // The window geometry is in device-independent points and may not match the content or
+ // framebuffer size in macOS. Multiply by the content scaling factor to get the real size.
+ double scaling_factor = m_render_frame->GetContentScaleFactor();
+ g_renderer->ResizeSurface(static_cast<int>(width * scaling_factor),
+ static_cast<int>(height * scaling_factor));
+ }
}
event.Skip();
}