Skip to content

Commit

Permalink
Fix scroll Bar is not accurately reflecting the virtual viewport posi…
Browse files Browse the repository at this point in the history
…tion.
  • Loading branch information
Delsin-Yu committed Apr 22, 2024
1 parent a9785b5 commit f5f898d
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 f5f898d

Please sign in to comment.