diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 5ba42b6937..13106ec3f0 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -114,6 +114,9 @@ const int DRAG_SENSITIVITY = 3; // the space between the cell edge and the checkbox mark const int GRID_CELL_CHECKBOX_MARGIN = 2; +// the margin between a cell vertical line and a cell text +const int GRID_TEXT_MARGIN = 1; + } // anonymous namespace #include "wx/arrimpl.cpp" @@ -6814,9 +6817,9 @@ void wxGrid::DrawTextRectangle(wxDC& dc, { case wxALIGN_BOTTOM: if ( textOrientation == wxHORIZONTAL ) - y = rect.y + (rect.height - textHeight - 1); + y = rect.y + (rect.height - textHeight - GRID_TEXT_MARGIN); else - x = rect.x + rect.width - textWidth; + x = rect.x + (rect.width - textWidth - GRID_TEXT_MARGIN); break; case wxALIGN_CENTRE: @@ -6829,9 +6832,9 @@ void wxGrid::DrawTextRectangle(wxDC& dc, case wxALIGN_TOP: default: if ( textOrientation == wxHORIZONTAL ) - y = rect.y + 1; + y = rect.y + GRID_TEXT_MARGIN; else - x = rect.x + 1; + x = rect.x + GRID_TEXT_MARGIN; break; } @@ -6855,9 +6858,9 @@ void wxGrid::DrawTextRectangle(wxDC& dc, { case wxALIGN_RIGHT: if ( textOrientation == wxHORIZONTAL ) - x = rect.x + (rect.width - lineWidth - 1); + x = rect.x + (rect.width - lineWidth - GRID_TEXT_MARGIN); else - y = rect.y + lineWidth + 1; + y = rect.y + lineWidth + GRID_TEXT_MARGIN; break; case wxALIGN_CENTRE: @@ -6870,9 +6873,9 @@ void wxGrid::DrawTextRectangle(wxDC& dc, case wxALIGN_LEFT: default: if ( textOrientation == wxHORIZONTAL ) - x = rect.x + 1; + x = rect.x + GRID_TEXT_MARGIN; else - y = rect.y + rect.height - 1; + y = rect.y + rect.height - GRID_TEXT_MARGIN; break; } @@ -6904,7 +6907,7 @@ void wxGrid::DrawTextRectangle(wxDC& dc, text, dc, attr.GetFitMode().GetEllipsizeMode(), - rect.GetWidth(), + rect.GetWidth() - 2 * GRID_TEXT_MARGIN, wxELLIPSIZE_FLAGS_NONE );