Browse Source
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
pull/17812/head
Maxwell Katz
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
6 additions and
6 deletions
-
src/Avalonia.Base/Platform/DefaultPlatformSettings.cs
-
src/Windows/Avalonia.Win32/Win32PlatformSettings.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), |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
@ -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) |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|