Skip to content

Commit

Permalink
Merge pull request #5 from Delsin-Yu/scroll-bar-is-not-accurately-ref…
Browse files Browse the repository at this point in the history
…lecting-the-virtual-viewport-position

Fix scroll Bar is not accurately reflecting the virtual viewport position.
  • Loading branch information
Delsin-Yu authored Apr 22, 2024
2 parents a9785b5 + f5f898d commit e9a5b96
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions GDViews.VirtualGridView/Core/VirtualGridViewImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ internal class VirtualGridViewImpl<TDataType, TButtonType, TExtraArgument> :

private NullableData<TDataType> _currentSelectedData;
private int _currentSelectedViewColumnIndex;

private int _currentSelectedViewRowIndex;

private DataView[,] _currentView;
Expand Down Expand Up @@ -797,9 +796,10 @@ private void UpdateScrollBar(int dataRows, int dataColumns, bool noAnimation = f
}
else
{
rowProgress = ViewRowIndex / (float)(dataRows - ViewRows);
var fixedDataRows = (float)dataRows;
rowProgress = ViewRowIndex / fixedDataRows;
rowProgress = Math.Max(rowProgress, 0f);
rowPage = ViewRows / (float)dataRows;
rowPage = ViewRows / fixedDataRows;
canAutoHideRowScrollBar = false;
}

Expand All @@ -811,9 +811,10 @@ private void UpdateScrollBar(int dataRows, int dataColumns, bool noAnimation = f
}
else
{
columnProgress = ViewColumnIndex / (float)(dataColumns - ViewColumns);
var fixedDataColumns = (float)dataColumns;
columnProgress = ViewColumnIndex / fixedDataColumns;
columnProgress = Math.Max(columnProgress, 0f);
columnPage = ViewColumns / (float)dataColumns;
columnPage = ViewColumns / fixedDataColumns;
canAutoHideColumnScrollBar = false;
}

Expand Down

0 comments on commit e9a5b96

Please sign in to comment.