Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ private void OnScrollGesture(object? sender, ScrollGestureEventArgs e)
Vector delta = default;
if (isLogical)
_activeLogicalGestureScrolls?.TryGetValue(e.Id, out delta);
delta += e.Delta;
delta += CheckFlowDirection(e.Delta);

if (isLogical && scrollable is object)
{
Expand Down Expand Up @@ -665,7 +665,7 @@ protected override void OnPointerWheelChanged(PointerWheelEventArgs e)

var x = Offset.X;
var y = Offset.Y;
var delta = e.Delta;
var delta = CheckFlowDirection(e.Delta);

// KeyModifiers.Shift should scroll in horizontal direction. This does not work on every platform.
// If Shift-Key is pressed and X is close to 0 we swap the Vector.
Expand Down Expand Up @@ -1065,5 +1065,14 @@ private static (double previous, double next) FindNearestSnapPoint(IReadOnlyList

return snapPointsInfo;
}

private Vector CheckFlowDirection(Vector delta)
{
if (FlowDirection == Media.FlowDirection.RightToLeft)
{
return delta.WithX(-delta.X);
}
return delta;
}
}
}
Loading