From b8808386b25fc4d78954f52574300653d1d4ca1f Mon Sep 17 00:00:00 2001 From: Maxwell Katz Date: Tue, 17 Dec 2024 13:25:05 +0000 Subject: [PATCH] Update pen tap settings (#17780) * Apply touch TapSize settings for Pen too * Windows: use GetSystemMetrics only for Mouse pointer type, and call base implementation for rest --- src/Avalonia.Base/Platform/DefaultPlatformSettings.cs | 4 ++-- src/Windows/Avalonia.Win32/Win32PlatformSettings.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Avalonia.Base/Platform/DefaultPlatformSettings.cs b/src/Avalonia.Base/Platform/DefaultPlatformSettings.cs index e6cc6b872d..5f17627ace 100644 --- a/src/Avalonia.Base/Platform/DefaultPlatformSettings.cs +++ b/src/Avalonia.Base/Platform/DefaultPlatformSettings.cs @@ -18,7 +18,7 @@ namespace Avalonia.Platform { return type switch { - PointerType.Touch => new(10, 10), + PointerType.Touch or PointerType.Pen => new(10, 10), _ => new(4, 4), }; } @@ -27,7 +27,7 @@ namespace Avalonia.Platform { return type switch { - PointerType.Touch => new(16, 16), + PointerType.Touch or PointerType.Pen => new(16, 16), _ => new(4, 4), }; } diff --git a/src/Windows/Avalonia.Win32/Win32PlatformSettings.cs b/src/Windows/Avalonia.Win32/Win32PlatformSettings.cs index 0372979824..c4b016c1b9 100644 --- a/src/Windows/Avalonia.Win32/Win32PlatformSettings.cs +++ b/src/Windows/Avalonia.Win32/Win32PlatformSettings.cs @@ -18,8 +18,8 @@ internal class Win32PlatformSettings : DefaultPlatformSettings { return type switch { - PointerType.Touch => new(10, 10), - _ => new(GetSystemMetrics(SystemMetric.SM_CXDRAG), GetSystemMetrics(SystemMetric.SM_CYDRAG)), + PointerType.Mouse => new(GetSystemMetrics(SystemMetric.SM_CXDRAG), GetSystemMetrics(SystemMetric.SM_CYDRAG)), + _ => base.GetTapSize(type) }; } @@ -27,8 +27,8 @@ internal class Win32PlatformSettings : DefaultPlatformSettings { return type switch { - PointerType.Touch => new(16, 16), - _ => new(GetSystemMetrics(SystemMetric.SM_CXDOUBLECLK), GetSystemMetrics(SystemMetric.SM_CYDOUBLECLK)), + PointerType.Mouse => new(GetSystemMetrics(SystemMetric.SM_CXDOUBLECLK), GetSystemMetrics(SystemMetric.SM_CYDOUBLECLK)), + _ => base.GetDoubleTapSize(type) }; }