Browse Source

Perform check if the scroll should be changed on shift key.

This may variy by platform, so we need an additional check.
pull/7520/head
Tim 5 years ago
parent
commit
c1e101f491
  1. 5
      src/Avalonia.Input/MouseDevice.cs

5
src/Avalonia.Input/MouseDevice.cs

@ -5,6 +5,7 @@ using System.Reactive.Linq;
using Avalonia.Input.Raw;
using Avalonia.Interactivity;
using Avalonia.Platform;
using Avalonia.Utilities;
using Avalonia.VisualTree;
namespace Avalonia.Input
@ -334,7 +335,9 @@ namespace Avalonia.Input
var hit = HitTest(root, p);
var source = GetSource(hit);
if (inputModifiers == KeyModifiers.Shift)
// 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.
if (inputModifiers == KeyModifiers.Shift && MathUtilities.IsZero(delta.X))
{
delta = new Vector(delta.Y, delta.X);
}

Loading…
Cancel
Save