diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp index 9ca684d155..e453d32734 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp @@ -361,6 +361,15 @@ void CCodeView::OnPaint(wxPaintEvent& event) dc.SetFont(DebuggerFont); + wxCoord w,h; + dc.GetTextExtent(_T("0WJyq"),&w,&h); + + if (h > rowHeight) + rowHeight = h; + + dc.GetTextExtent(_T("W"),&w,&h); + int charWidth = w; + struct branch { int src, dst, srcAddr; @@ -480,7 +489,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) dc.SetTextForeground(_T("#000000")); } - dc.DrawText(wxString::FromAscii(dis2), 140, rowY1); + dc.DrawText(wxString::FromAscii(dis2), 18*charWidth, rowY1); // ------------ } @@ -490,7 +499,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) else dc.SetTextForeground(_T("#8000FF")); // purple - dc.DrawText(wxString::FromAscii(dis), plain ? 25 : 80, rowY1); + dc.DrawText(wxString::FromAscii(dis), plain ? 3*charWidth : 10*charWidth, rowY1); if (desc[0] == 0) { @@ -504,7 +513,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) //UnDecorateSymbolName(desc,temp,255,UNDNAME_COMPLETE); if (strlen(desc)) { - dc.DrawText(wxString::FromAscii(desc), 270, rowY1); + dc.DrawText(wxString::FromAscii(desc), 38 * charWidth, rowY1); } } @@ -525,7 +534,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) for (int i = 0; i < numBranches; i++) { - int x = 370 + (branches[i].srcAddr % 9) * 8; + int x = 46 * charWidth + (branches[i].srcAddr % 9) * 8; _MoveTo(x-2, branches[i].src); if (branches[i].dst < rc.height + 400 && branches[i].dst > -400) diff --git a/Source/Core/DolphinWX/Src/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Src/Debugger/MemoryView.cpp index ebbc317c97..328a6e08a3 100644 --- a/Source/Core/DolphinWX/Src/Debugger/MemoryView.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/MemoryView.cpp @@ -205,17 +205,24 @@ void CMemoryView::OnPaint(wxPaintEvent& event) wxPaintDC dc(this); wxRect rc = GetClientRect(); wxFont hFont(_T("Courier")); - + hFont.SetFamily(wxFONTFAMILY_TELETYPE); + + wxCoord w,h; + dc.GetTextExtent(_T("0WJyq"),&w,&h,NULL,NULL,&hFont); + if (h > rowHeight) + rowHeight = h; + dc.GetTextExtent(_T("0WJyq"),&w,&h,NULL,NULL,&DebuggerFont); + if (h > rowHeight) + rowHeight = h; + if (viewAsType==VIEWAS_HEX) - { - hFont.SetFamily(wxFONTFAMILY_TELETYPE); dc.SetFont(hFont); - } else dc.SetFont(DebuggerFont); - int fontSize = viewAsType == VIEWAS_HEX ? hFont.GetPointSize() : DebuggerFont.GetPointSize(); - int textPlacement = 77; + dc.GetTextExtent(_T("W"),&w,&h); + int fontSize = w; + int textPlacement = 11 * fontSize; struct branch { int src, dst, srcAddr; @@ -356,7 +363,7 @@ void CMemoryView::OnPaint(wxPaintEvent& event) if (viewAsType != VIEWAS_HEX) dc.DrawText(wxString::FromAscii(dis), textPlacement + fontSize*(8 + 8), rowY1); else - dc.DrawText(wxString::FromAscii(dis), textPlacement + 8+16, rowY1); + dc.DrawText(wxString::FromAscii(dis), textPlacement, rowY1); if (desc[0] == 0) strcpy(desc, debugger->getDescription(address).c_str());