grid: fix makeCellVisible for cases when too low space in scroll area

This commit is contained in:
Vadim Lopatin 2014-12-22 10:37:00 +03:00
parent 38d2c5d1b0
commit eda23b1bc6
1 changed files with 4 additions and 2 deletions
src/dlangui/widgets

View File

@ -571,8 +571,8 @@ class GridWidgetBase : ScrollWidgetBase {
scrolled = true; scrolled = true;
} else { } else {
while (rc.right > _clientRect.width && _scrollCol < _cols - _fixedCols - _headerCols - 1) { while (rc.right > _clientRect.width && _scrollCol < _cols - _fixedCols - _headerCols - 1) {
// if (_scrollCol == _col) if (_scrollCol == col - _headerCols - _fixedCols)
// break; break;
_scrollCol++; _scrollCol++;
rc = cellRect(col, row); rc = cellRect(col, row);
scrolled = true; scrolled = true;
@ -584,6 +584,8 @@ class GridWidgetBase : ScrollWidgetBase {
scrolled = true; scrolled = true;
} else { } else {
while (rc.bottom > _clientRect.height && _scrollRow < _rows - _fixedRows - _headerRows - 1) { while (rc.bottom > _clientRect.height && _scrollRow < _rows - _fixedRows - _headerRows - 1) {
if (_scrollRow == row - _headerRows - _fixedRows)
break;
_scrollRow++; _scrollRow++;
rc = cellRect(col, row); rc = cellRect(col, row);
scrolled = true; scrolled = true;