Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinUI3: Rotation in Manipulation events is wrong #3658

Closed
dotMorten opened this issue Nov 19, 2020 · 6 comments
Closed

WinUI3: Rotation in Manipulation events is wrong #3658

dotMorten opened this issue Nov 19, 2020 · 6 comments
Labels
product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team

Comments

@dotMorten
Copy link
Contributor

dotMorten commented Nov 19, 2020

Describe the bug
When using the ManipulationDelta event to track rotation changes, the values reported are way too large. Rotating your fingers reports a value exactly 180/Pi too large.

Steps to reproduce the bug

  1. Add the following XAML to the view:
        <Border Background="Red" Width="300" Height="300" 
                ManipulationMode="All"
                ManipulationStarted="Border_ManipulationStarted"
                ManipulationDelta="Border_ManipulationDelta"
                ManipulationCompleted="Border_ManipulationCompleted">
            <TextBlock Text="Rotate me" x:Name="status" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Border>
  1. Add the following code-behind:
        private double angle = 0;
        private void Border_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
        {
            angle = 0;
            status.Text = "Begin";
        }

        private void Border_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            angle += e.Delta.Rotation;
            status.Text = $"Cumulative (sum of deltas): {angle}\nDelta: {e.Delta.Rotation}\nCumulative: {e.Cumulative.Rotation}";
        }

        private void Border_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            status.Text += "\nCompleted!";
        }
  1. Run the application on a touch screen, and rotate with two fingers over the red box.
  2. Observe the values reported doesn't match what you're doing (all 3 values written are wrong of about 17-18 times larger than expected).

Expected behavior
Rotation values reported matches actual user input

Screenshots
Untitled Project

Version Info

NuGet package version:
[Microsoft.WinUI 3.0.0-preview3.201113.0]

Windows app type:

UWP Win32
Yes Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041) Yes
November 2019 Update (18363) Yes
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes (Surface Book 2 & Surface Go 1
Xbox
Surface Hub
IoT

Additional context

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Nov 19, 2020
@StephenLPeters StephenLPeters added team-Rendering Issue for the Rendering team product-winui3 WinUI 3 issues needs-triage Issue needs to be triaged by the area owners and removed needs-triage Issue needs to be triaged by the area owners labels Nov 20, 2020
@StephenLPeters
Copy link
Contributor

@codendone FYI

@codendone codendone removed the needs-triage Issue needs to be triaged by the area owners label Nov 20, 2020
@codendone
Copy link
Contributor

Thanks for reporting. As you found, there is a place where we're incorrectly converting radians to degrees when the value was already in degrees.

@dotMorten
Copy link
Contributor Author

dotMorten commented Apr 13, 2021

@codendone Any update on this? Sounds like an easy fix, and some might consider this a breaking behavior down the line once it's v1.0

@codendone
Copy link
Contributor

I agree, and I had hoped we'd get to this sooner. This is scheduled to be fixed for 0.8, and hopefully will be completed around the end of April.

@anawishnoff
Copy link
Contributor

This has been fixed in the most recent release of WinUI 3 (Windows App SDK 0.8), so I'm closing this issue. Feel free to re-open if the issue still persists.

@dotMorten
Copy link
Contributor Author

sorry forgot to close this when I confirmed the fix last week. Thank you!

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jun 29, 2021
@krschau krschau removed the needs-triage Issue needs to be triaged by the area owners label Jul 26, 2021
@bpulliam bpulliam removed the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests

6 participants