From 0ba23e1ccc60e18910a1ffc451aafae6d91d88cc Mon Sep 17 00:00:00 2001 From: lindexi Date: Fri, 22 Jul 2022 09:34:04 +0800 Subject: [PATCH] Inline the value --- .../System/Windows/Input/Stylus/Common/StylusLogic.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/StylusLogic.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/StylusLogic.cs index 75c9afe622a..08276e69a3b 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/StylusLogic.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/StylusLogic.cs @@ -428,8 +428,7 @@ protected Matrix GetAndCacheTransformToDeviceMatrix(PresentationSource source) Type compositionTargetType = compositionTarget.GetType(); if (compositionTargetType == typeof(HwndTarget)) { - var hwndTarget = (HwndTarget) compositionTarget; - DpiScale2 currentDpiScale = hwndTarget.CurrentDpiScale; + DpiScale2 currentDpiScale = compositionTarget.CurrentDpiScale; toDevice.Scale(currentDpiScale.DpiScaleX, currentDpiScale.DpiScaleY); } else