From 1a0087b5215c7e0501f911e70c7ebb557e72f408 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Mon, 11 Apr 2022 14:35:40 +0200 Subject: [PATCH] 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. --- src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs b/src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs index 97fb4c3f43..a8bffcc842 100644 --- a/src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs +++ b/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;