简体   繁体   English

UNO Wpf/Windows 中的鼠标滞后

[英]Mouse Lag in UNO Wpf/Windows

Im trying to build a high performance app on UNO platform (WPF/Windows/Wasm) that allows the user to draw primitive shapes (lines, rectanges, etc) Since it will have snapping to points, and showing snap point it should be smooth.我正在尝试在 UNO 平台(WPF/Windows/Wasm)上构建一个高性能应用程序,允许用户绘制原始形状(线、矩形等),因为它会捕捉到点,并显示捕捉点,它应该是平滑的。

The mouse lags when moving over the canvas, the lag is small, but users of this app will be working very quickly and these lags make it feel unresponsive.鼠标在 canvas 上移动时有延迟,延迟很小,但是这个应用程序的用户会很快工作,这些延迟让人感觉反应迟钝。 Is there any way to speed this up?有什么办法可以加快速度吗?

A simple white box demo一个简单的白盒演示

MainPage.Xaml主页.Xaml

   <Grid>
        <Canvas  Width="2088" Height="2100.17014099374" x:Name="MainCanvas" >
            <Canvas.Background>
                <SolidColorBrush Color="#eaeaea"></SolidColorBrush>
            </Canvas.Background>
            <Ellipse Name="SnapPoint" Canvas.Top="400" Canvas.Left="400" Width="25" Height="25" Fill="Blue"></Ellipse>
        </Canvas>
    </Grid>

MainPage.Xaml.cs MainPage.Xaml.cs

 private void MainCanvas_PointerMoved(object sender, PointerRoutedEventArgs e)
 {
     var position = e.GetCurrentPoint(MainCanvas).Position;

     Canvas.SetLeft(SnapPoint, position.X);
     Canvas.SetTop(SnapPoint, position.Y);
  }

I have also tried binding the Left and Top properties of the ellipse to view model, but the delay is the same.我也试过绑定椭圆的Left和Top属性来查看model,但是延迟是一样的。

I was using remote desktop from Mac to Windows, this caused a delay in the mouse pointer on the screen我正在使用从 Mac 到 Windows 的远程桌面,这导致屏幕上的鼠标指针出现延迟

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM