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.
This commit is contained in:
Stenzek 2018-04-03 00:55:52 +10:00
parent 467379c149
commit 210a6a37b4
1 changed files with 7 additions and 1 deletions

View File

@ -614,7 +614,13 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event)
m_log_window->Update(); m_log_window->Update();
if (g_renderer) 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(); event.Skip();
} }