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

setting stick X and Y to base X and Y in _onUp when stationarybase: true #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ssugar
Copy link

@ssugar ssugar commented Aug 2, 2016

When using a stationary base, stickX and stickY are not reset to anything in the _onUp function, so deltaX and deltaY keep returning the last value prior to _onUp being called.

Setting stickX = baseX and stickY = baseY when stationarybase is not false (as in my pull request) fixes this.

@erichlof
Copy link
Contributor

erichlof commented Aug 3, 2016

@ssugar
Thank you noticing this and for the fix! It was an oversight on my part. I was the one a while back who added the stationary base stuff.
@jeromeetienne
This fix looks good to me. btw, long time no hear, hope you are doing well Jerome! :-)

Thanks again @ssugar

@ssugar
Copy link
Author

ssugar commented Aug 3, 2016

No worries. Happy to contribute. Virtualkeyboard.js is a cool library. Thanks to you @erichlof and @jeromeetienne

I'll also send through another commit for a prototype I wrote that returns the angle of the stick based on the dx dy between the stick and the base.

0 degress is the exact right of the base, moves counterclockwise through to 360 degrees which takes you back to the exact right of the base.

Maybe I should have created this as separate pull request? If so, let me know and I'll try to fix this up.

Cheers

@erichlof
Copy link
Contributor

erichlof commented Aug 4, 2016

@ssugar
Sounds good to me, (just add the angle stuff to this PR) although @jeromeetienne has the final say because this is his library. Yes, virtualjoystick is a great tool, it is my go-to library when I need touch interactions in Javascript. Thanks for your contributions:-)

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