Only overflow left-aligned cells in wxGrid

Doing it for cells using a different alignment doesn't work correctly
and it's not clear whether it really makes sense, so just don't do it at
all for now.

Closes https://github.com/wxWidgets/wxWidgets/pull/1726
This commit is contained in:
Ilya Sinitsyn 2020-02-05 00:48:52 +07:00 committed by Vadim Zeitlin
parent a40acbb28e
commit e0c09c8438
2 changed files with 6 additions and 2 deletions

View File

@ -6086,7 +6086,11 @@ void wxGrid::DrawGridCellArea( wxDC& dc, const wxGridCellCoordsArray& cells )
{
if (!m_table->IsEmptyCell(row + l, j))
{
if (GetCellOverflow(row + l, j))
wxGridCellAttr *attr = GetCellAttr(row + l, j);
const bool canOverflow = attr->CanOverflow();
attr->DecRef();
if ( canOverflow )
{
wxGridCellCoords cell(row + l, j);
bool marked = false;

View File

@ -591,7 +591,7 @@ void wxGridCellStringRenderer::Draw(wxGrid& grid,
// erase only this cells background, overflow cells should have been erased
wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected);
if (attr.GetOverflow())
if ( attr.CanOverflow() )
{
int hAlign, vAlign;
attr.GetAlignment(&hAlign, &vAlign);