From eda23b1bc6796de1b8f279b7624ea8c2439ea4f9 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Mon, 22 Dec 2014 10:37:00 +0300 Subject: [PATCH] grid: fix makeCellVisible for cases when too low space in scroll area --- src/dlangui/widgets/grid.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dlangui/widgets/grid.d b/src/dlangui/widgets/grid.d index bfe23484..50784efc 100644 --- a/src/dlangui/widgets/grid.d +++ b/src/dlangui/widgets/grid.d @@ -571,8 +571,8 @@ class GridWidgetBase : ScrollWidgetBase { scrolled = true; } else { while (rc.right > _clientRect.width && _scrollCol < _cols - _fixedCols - _headerCols - 1) { -// if (_scrollCol == _col) -// break; + if (_scrollCol == col - _headerCols - _fixedCols) + break; _scrollCol++; rc = cellRect(col, row); scrolled = true; @@ -584,6 +584,8 @@ class GridWidgetBase : ScrollWidgetBase { scrolled = true; } else { while (rc.bottom > _clientRect.height && _scrollRow < _rows - _fixedRows - _headerRows - 1) { + if (_scrollRow == row - _headerRows - _fixedRows) + break; _scrollRow++; rc = cellRect(col, row); scrolled = true;