From 0e951befdf45cb66422fb31a10d8193b57b4fc21 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Wed, 9 Nov 2022 15:27:46 +0100 Subject: [PATCH] Use DefaultPlatformSettings in Web platform. --- src/Web/Avalonia.Web/WindowingPlatform.cs | 24 ++--------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/Web/Avalonia.Web/WindowingPlatform.cs b/src/Web/Avalonia.Web/WindowingPlatform.cs index 29c797660f..c399c22c61 100644 --- a/src/Web/Avalonia.Web/WindowingPlatform.cs +++ b/src/Web/Avalonia.Web/WindowingPlatform.cs @@ -8,7 +8,7 @@ using Avalonia.Threading; namespace Avalonia.Web { - internal class BrowserWindowingPlatform : IWindowingPlatform, IPlatformSettings, IPlatformThreadingInterface + internal class BrowserWindowingPlatform : IWindowingPlatform, IPlatformThreadingInterface { private bool _signaled; private static KeyboardDevice? s_keyboard; @@ -36,7 +36,7 @@ namespace Avalonia.Web .Bind().ToSingleton() .Bind().ToSingleton() .Bind().ToConstant(s_keyboard) - .Bind().ToConstant(instance) + .Bind().ToSingleton() .Bind().ToConstant(instance) .Bind().ToConstant(new RenderLoop()) .Bind().ToConstant(ManualTriggerRenderTimer.Instance) @@ -94,25 +94,5 @@ namespace Avalonia.Web { return AvaloniaLocator.Current.GetRequiredService(); } - - Size IPlatformSettings.GetTapSize(PointerType type) - { - return type switch - { - PointerType.Touch => new(10, 10), - _ => new(4, 4), - }; - } - - Size IPlatformSettings.GetDoubleTapSize(PointerType type) - { - return type switch - { - PointerType.Touch => new(16, 16), - _ => new(4, 4), - }; - } - - TimeSpan IPlatformSettings.GetDoubleTapTime(PointerType type) => TimeSpan.FromMilliseconds(500); } }