Skip to content

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 OdNairy force-pushed the bugfix/cgpoint-angle-offset branch from cbd30a2 to ecbe2ae Compare April 28, 2023 15:50
@keith keith requested a review from gabriellanata April 28, 2023 15:51
@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?

@OdNairy OdNairy force-pushed the bugfix/cgpoint-angle-offset branch from 3538b7d to fd61396 Compare July 9, 2025 12:29
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