Skip to content

Commit ad5aa43

Browse files
authored
Merge pull request #30 from dotnet-campus/t/lindexi/FixStylusPlugInOrder_Internal
Fix StylusPlugIn OnStylusDown/Move/Up invoked on UI thread and called out of order
2 parents 815f5a9 + 4273d77 commit ad5aa43

File tree

1 file changed

+2
-2
lines changed
  • src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Wisp

1 file changed

+2
-2
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Wisp/PenContexts.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

@@ -512,7 +512,7 @@ internal StylusPlugInCollection TargetPlugInCollection(RawStylusInputReport inpu
512512
ptTablet = ptTablet * stylusDevice.TabletDevice.TabletDeviceImpl.TabletToScreen;
513513
ptTablet.X = (int)Math.Round(ptTablet.X); // Make sure we snap to whole window pixels.
514514
ptTablet.Y = (int)Math.Round(ptTablet.Y);
515-
ptTablet = _stylusLogic.MeasureUnitsFromDeviceUnits(stylusDevice.CriticalActiveSource, ptTablet); // change to measured units now.
515+
ptTablet = _stylusLogic.MeasureUnitsFromDeviceUnits(inputReport.InputSource ?? stylusDevice.CriticalActiveSource, ptTablet); // change to measured units now.
516516

517517
pic = HittestPlugInCollection(ptTablet); // Use cached rectangles for UIElements.
518518
}

0 commit comments

Comments
 (0)