Skip to content
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -3712,7 +3712,10 @@ protected override void OnPointerWheelChanged(PointerRoutedEventArgs e)
if (!e.Handled)
{
PointerPoint pointerPoint = e.GetCurrentPoint(this);
bool isForHorizontalScroll = pointerPoint.Properties.IsHorizontalMouseWheel;

// A horizontal scroll happens if the mouse has a horizontal wheel OR if the horizontal scrollbar is not disabled AND the vertical scrollbar IS disabled
bool isForHorizontalScroll = pointerPoint.Properties.IsHorizontalMouseWheel ||
(this.HorizontalScrollBarVisibility != ScrollBarVisibility.Disabled && this.VerticalScrollBarVisibility == ScrollBarVisibility.Disabled);

if ((isForHorizontalScroll && this.HorizontalScrollBarVisibility == ScrollBarVisibility.Disabled) ||
(!isForHorizontalScroll && this.VerticalScrollBarVisibility == ScrollBarVisibility.Disabled))
Expand All @@ -3721,7 +3724,7 @@ protected override void OnPointerWheelChanged(PointerRoutedEventArgs e)
}

double offsetDelta = -pointerPoint.Properties.MouseWheelDelta / DATAGRID_mouseWheelDeltaDivider;
if (isForHorizontalScroll)
if (isForHorizontalScroll && pointerPoint.Properties.IsHorizontalMouseWheel)
{
offsetDelta *= -1.0;
}
Expand Down