mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-13 07:58:36 +02:00
WxDebugger: Fix variable width fonts in Code/Memory views
This commit is contained in:
parent
7b29b3c571
commit
94aff7e47e
@ -390,8 +390,9 @@ void CCodeView::OnPaint(wxPaintEvent& event)
|
|||||||
{
|
{
|
||||||
wxFontMetrics metrics = paint_dc.GetFontMetrics();
|
wxFontMetrics metrics = paint_dc.GetFontMetrics();
|
||||||
char_width = metrics.averageWidth;
|
char_width = metrics.averageWidth;
|
||||||
if (metrics.height > m_rowHeight)
|
m_rowHeight = std::max(metrics.height, m_rowHeight);
|
||||||
m_rowHeight = metrics.height;
|
if (!DebuggerFont.IsFixedWidth())
|
||||||
|
char_width = paint_dc.GetTextExtent("mxx").GetWidth() / 3; // (1em + 2ex) / 3
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<wxGraphicsContext> ctx(wxGraphicsContext::Create(paint_dc));
|
std::unique_ptr<wxGraphicsContext> ctx(wxGraphicsContext::Create(paint_dc));
|
||||||
|
@ -269,22 +269,15 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
|||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
wxRect rc = GetClientRect();
|
wxRect rc = GetClientRect();
|
||||||
|
|
||||||
if (DebuggerFont.IsFixedWidth())
|
dc.SetFont(DebuggerFont);
|
||||||
{
|
|
||||||
dc.SetFont(DebuggerFont);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dc.SetFont(wxFont(DebuggerFont.GetPointSize(), wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
|
|
||||||
wxFONTWEIGHT_NORMAL, false, "Courier"));
|
|
||||||
}
|
|
||||||
|
|
||||||
int font_width;
|
int font_width;
|
||||||
{
|
{
|
||||||
wxFontMetrics metrics = dc.GetFontMetrics();
|
wxFontMetrics metrics = dc.GetFontMetrics();
|
||||||
font_width = metrics.averageWidth;
|
font_width = metrics.averageWidth;
|
||||||
if (metrics.height > rowHeight)
|
rowHeight = std::max(rowHeight, metrics.height);
|
||||||
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;
|
const int row_start_x = m_left_col_width + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user