summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Debugger/MemoryView.cpp
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2016-10-04 01:39:27 -0700
committerGitHub <noreply@github.com>2016-10-04 01:39:27 -0700
commit037f0a1803c274ce7e9f97ff9b7baed2955b9004 (patch)
tree79d57febaac5f6cef1ddec489049eebea5460476 /Source/Core/DolphinWX/Debugger/MemoryView.cpp
parent7b29b3c5711b5bdd41dd65f315f7bcb850637957 (diff)
parent116348a8777ee7961bbf2f674adcc6420ddc9cb0 (diff)
Merge pull request #4290 from EmptyChaos/varwidth-fonts
WxDebugger: Fix variable width fonts in Code/Memory views
Diffstat (limited to 'Source/Core/DolphinWX/Debugger/MemoryView.cpp')
-rw-r--r--Source/Core/DolphinWX/Debugger/MemoryView.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Debugger/MemoryView.cpp
index 47c2969dc2..67a38aa0b5 100644
--- a/Source/Core/DolphinWX/Debugger/MemoryView.cpp
+++ b/Source/Core/DolphinWX/Debugger/MemoryView.cpp
@@ -269,22 +269,15 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
wxPaintDC dc(this);
wxRect rc = GetClientRect();
- if (DebuggerFont.IsFixedWidth())
- {
- dc.SetFont(DebuggerFont);
- }
- else
- {
- dc.SetFont(wxFont(DebuggerFont.GetPointSize(), wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
- wxFONTWEIGHT_NORMAL, false, "Courier"));
- }
+ dc.SetFont(DebuggerFont);
int font_width;
{
wxFontMetrics metrics = dc.GetFontMetrics();
font_width = metrics.averageWidth;
- if (metrics.height > rowHeight)
- rowHeight = metrics.height;
+ rowHeight = std::max(rowHeight, metrics.height);
+ if (!DebuggerFont.IsFixedWidth())
+ font_width = dc.GetTextExtent("mxx").GetWidth() / 3; // (1em + 2ex) / 3
}
const int row_start_x = m_left_col_width + 1;