diff options
| author | shuffle2 <godisgovernment@gmail.com> | 2016-10-04 01:39:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-04 01:39:27 -0700 |
| commit | 037f0a1803c274ce7e9f97ff9b7baed2955b9004 (patch) | |
| tree | 79d57febaac5f6cef1ddec489049eebea5460476 /Source/Core/DolphinWX/Debugger/CodeView.cpp | |
| parent | 7b29b3c5711b5bdd41dd65f315f7bcb850637957 (diff) | |
| parent | 116348a8777ee7961bbf2f674adcc6420ddc9cb0 (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/CodeView.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Debugger/CodeView.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 8bc07036b3..6d605b48a4 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -390,8 +390,9 @@ void CCodeView::OnPaint(wxPaintEvent& event) { wxFontMetrics metrics = paint_dc.GetFontMetrics(); char_width = metrics.averageWidth; - if (metrics.height > m_rowHeight) - m_rowHeight = metrics.height; + m_rowHeight = std::max(metrics.height, m_rowHeight); + if (!DebuggerFont.IsFixedWidth()) + char_width = paint_dc.GetTextExtent("mxx").GetWidth() / 3; // (1em + 2ex) / 3 } std::unique_ptr<wxGraphicsContext> ctx(wxGraphicsContext::Create(paint_dc)); @@ -545,7 +546,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) // UnDecorateSymbolName(desc,temp,255,UNDNAME_COMPLETE); if (!desc.empty()) { - ctx->DrawText(StrToWxStr(desc), text_col + 45 * char_width, row_y); + ctx->DrawText(StrToWxStr(desc), text_col + 44 * char_width, row_y); } } @@ -569,7 +570,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) for (int i = 0; i < num_branches; ++i) { - int x = text_col + 52 * char_width + (branches[i].srcAddr % 9) * 8; + int x = text_col + 60 * char_width + (branches[i].srcAddr % 9) * 8; branch_path.MoveToPoint(x - 2 * scale, branches[i].src); if (branches[i].dst < rc.height + 400 && branches[i].dst > -400) |
