diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index da5fbe00fa..a9b5d36648 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -9401,7 +9401,7 @@ wxGrid::AutoSizeColOrRow(int colOrRow, bool setAsMin, wxGridDirection direction) dc.SetFont( GetLabelFont() ); // We add some margin around text for better readability. - const int margin = column ? 10 : 6; + const int margin = FromDIP(column ? 10 : 6); if ( column ) { diff --git a/tests/controls/gridtest.cpp b/tests/controls/gridtest.cpp index e8d83e7474..cadc110392 100644 --- a/tests/controls/gridtest.cpp +++ b/tests/controls/gridtest.cpp @@ -1019,7 +1019,7 @@ void GridTestCase::CheckFirstColAutoSize(int expected) void GridTestCase::AutoSizeColumn() { // Hardcoded extra margin for the columns used in grid.cpp. - const int margin = 10; + const int margin = m_grid->FromDIP(10); wxGridCellAttr *attr = m_grid->GetOrCreateCellAttr(0, 0); wxGridCellRenderer *renderer = attr->GetRenderer(m_grid, 0, 0);