Browse Source

Don't multiply logical scroll by ScrollSize.

`ScrollSize` is intended to be the amount scrolled when clicking the up/down line scroll buttons. The `logicalScrollItemSize` calculation should have already taken care of calculating this value for scroll gestures (this wasn't noticed before because the only place where it was checked was with `ItemsPresenter` which has a `ScrollSize.Height` of 1.
pull/7964/head
Steven Kirk 5 years ago
parent
commit
1a0087b521
  1. 4
      src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs

4
src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs

@ -389,7 +389,7 @@ namespace Avalonia.Controls.Presenters
{
var logicalUnits = delta.Y / logicalScrollItemSize.Y;
delta = delta.WithY(delta.Y - logicalUnits * logicalScrollItemSize.Y);
dy = logicalUnits * scrollable!.ScrollSize.Height;
dy = logicalUnits;
}
else
dy = delta.Y;
@ -407,7 +407,7 @@ namespace Avalonia.Controls.Presenters
{
var logicalUnits = delta.X / logicalScrollItemSize.X;
delta = delta.WithX(delta.X - logicalUnits * logicalScrollItemSize.X);
dx = logicalUnits * scrollable!.ScrollSize.Width;
dx = logicalUnits;
}
else
dx = delta.X;

Loading…
Cancel
Save