yoannmoinet / nipplejs

:video_game: A virtual joystick for touch capable interfaces.
https://yoannmoinet.github.io/nipplejs
MIT License
1.78k stars 185 forks source link

fix: use transform translate for nipple front #187

Closed MCArth closed 1 year ago

MCArth commented 2 years ago

As discussed in https://github.com/yoannmoinet/nipplejs/issues/168, this uses transform: translate instead of setting top/left on the nipple front.

Two notes that might be worth their own issue:

The npm prepare script runs on npm install, and setting NODE_ENV fails on windows. I'd personally prefer cross-env for something like this. Also, 6 of the tests fail without any of my changes? 6 still fail with them.

MCArth commented 2 years ago

If I read the code correctly, I also think if (opts.follow) { should be if (opts.follow && !opts.dataOnly) { here

yoannmoinet commented 2 years ago

Thanks for this, I'll have a look asap.

verekia commented 1 year ago

Any chance we could revive this PR and make it happen? :) I'm also seeing some significant FPS drop when moving the joystick.

MCArth commented 1 year ago

@verekia I've been using this branch in production since I made this PR and it seems stable, you could depend directly on it until @yoannmoinet deals with the pr

yoannmoinet commented 1 year ago

Hey sorry about that, thanks for the new ping. I'll get to it :D

yoannmoinet commented 1 year ago

Published in v0.10.0 Thanks a ton :bow:

verekia commented 1 year ago

Thanks a lot to you both!