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

Fix point calculation for twoWayOffset due to wrong angle direction #53

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

OdNairy
Copy link

@OdNairy OdNairy commented Apr 28, 2023

This PR address incorrect calculation for a twoWayOffset function. Expected behaviour (I guess) was to have two touches with 180° with configurable angle to the horizont.

After PR

let angle = -35 * (Double.pi / 180.0)
try eventGenerator.fingerPinch(fromDistance: 20, toDistance: 200, angle: angle, duration: 3)
fix.angle.mov

Before

Here is how it looks like for angle = 0:

horizontal.mov

And this is what we have for a 35 degrees angle:

angle.mov

@OdNairy
Copy link
Author

OdNairy commented Apr 28, 2023

@keith @gabriellanata Added GitHub Actions fixes

@OdNairy OdNairy force-pushed the bugfix/cgpoint-angle-offset branch from b089718 to 4404c8d Compare April 28, 2023 17:44
Copy link
Contributor

@gabriellanata gabriellanata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i'm a little confused on what this fixes. Seems like its working correctly right now: See the HandTests.testViewRotationGesture() test. The view rotates as expected. Are you specifying degrees or radians when trying to use this function?

@OdNairy
Copy link
Author

OdNairy commented Apr 28, 2023

@gabriellanata It is the fix for fingerPinch. I did expect that the angle would describe the angle between the horizontal line and the line connecting two touch locations. Was my assumption wrong?

let angle = -35 * (Double.pi / 180.0)
try eventGenerator.fingerPinch(fromDistance: 20, toDistance: 200, angle: angle, duration: 3)

@OdNairy
Copy link
Author

OdNairy commented May 9, 2023

@gabriellanata are you still confident that it's not an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants