From c619a20a65caf0fbf3f26fdc2118510dcbec58d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 23 Aug 2019 16:01:27 +0200 Subject: [PATCH] Fix display of memory view window on high-DPI displays. Fixes #11913. --- Windows/Debugger/Debugger_MemoryDlg.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Windows/Debugger/Debugger_MemoryDlg.cpp b/Windows/Debugger/Debugger_MemoryDlg.cpp index a60f3ebfec..6943a8b1a3 100644 --- a/Windows/Debugger/Debugger_MemoryDlg.cpp +++ b/Windows/Debugger/Debugger_MemoryDlg.cpp @@ -4,6 +4,7 @@ #include #include "..\resource.h" +#include "base/display.h" #include "util/text/utf8.h" #include "Core/Debugger/SymbolMap.h" @@ -218,6 +219,8 @@ void CMemoryDlg::Goto(u32 addr) void CMemoryDlg::Size() { + const float fontScale = 1.0f / g_dpi_scale_real_y; + RECT rc; GetClientRect(m_hDlg,&rc); int dw=rc.right-rc.left; @@ -225,8 +228,8 @@ void CMemoryDlg::Size() HWND memView = GetDlgItem(m_hDlg, IDC_MEMVIEW); HWND symList = GetDlgItem(m_hDlg, IDC_SYMBOLS); int wf = slRect.right-slRect.left; - int w = dw-3-wf; - int top = 48; + int w = dw - 3 * fontScale - wf; + int top = 48 * fontScale; MoveWindow(symList,0,top,wf,dh-top,TRUE); MoveWindow(memView,wf+4,top,w,dh-top,TRUE); }