Comments (3)
Something like adding:
if (opts.mode === 'static' && dist > opts.catchDistance) return;
just before:
// If distance is bigger than nipple's size
// we clamp the position.
if (dist > size) {
dist = size;
pos = u.findCoord(nipple.position, dist, angle);
}
is working nicely.
I also replaced:
if (opts.mode !== 'semi') {
process(nipple);
} else {
// In semi we check the distance of the touch
// to decide if we have to reset the nipple
var distance = u.distance(position, nipple.position);
if (distance <= opts.catchDistance) {
process(nipple);
} else {
nipple.destroy();
self.processOnStart(evt);
return;
}
}
by:
switch(opts.mode)
{
default:
process(nipple);
break;
case 'semi':
// In semi we check the distance of the touch
// to decide if we have to reset the nipple
var distance = u.distance(position, nipple.position);
if (distance <= opts.catchDistance) {
process(nipple);
} else {
nipple.destroy();
self.processOnStart(evt);
return;
}
break;
case 'static':
var distance = u.distance(position, nipple.position);
if (distance <= opts.catchDistance) process(nipple);
break;
}
So the nipple won't light up if we click farther than catchDistance.
from nipplejs.
Can you follow the template please?
Feel free to re-open once the description has been updated following the template.
from nipplejs.
Bonjour Yoan.
Aujourd'hui, j'avais un peu de temps libre et je me suis dit que j'allais mettre à jour nipplejs et enfin pouvoir m'occuper de ma FEAT correctement. Seulement, je n'arrive pas à compiler nipplejs. Quoi que je fasse avec les versions des dépendances, j'obtiens :
glob-parent <5.1.2
Severity: high
glob-parent vulnerable to Regular Expression Denial of Service in enclosure regex - https://github.com/advisories/GHSA-ww39-953v-wcq6
No fix available
node_modules/watchpack-chokidar2/node_modules/glob-parent
chokidar 1.0.0-rc1 - 2.1.8
Depends on vulnerable versions of glob-parent
node_modules/watchpack-chokidar2/node_modules/chokidar
watchpack-chokidar2 *
Depends on vulnerable versions of chokidar
node_modules/watchpack-chokidar2
watchpack 1.7.2 - 1.7.5
Depends on vulnerable versions of watchpack-chokidar2
node_modules/watchpack
4 high severity vulnerabilities
Est-ce qu'il y a quelque chose de particulier à faire ?
Merci
from nipplejs.
Related Issues (20)
- How to use this joystick with three js 3d object HOT 1
- [FEAT] Only count touches when joystick is pressed down
- [FEAT] Disable joystick movement
- Option for Touch / mobile only - ignore desktop mouse events HOT 3
- Joystick is frozen in Safari and Chrome on iOS 15.3 but not in Firefox [BUG] HOT 1
- joystick with other elements HOT 2
- [BUG] Joystick not appearing in correct location when used in the svelte framework HOT 5
- iOS safari shows zoom on longpress, is it possible to fix? HOT 1
- [BUG] Cant use both joysticks simultaneously
- Controlling Flash with nipple on touchscreen, what about buttons? HOT 4
- How to get 8 directions? HOT 4
- [BUG] dataOnly will create an exception in move event creation HOT 1
- [BUG] Pressure not working on MacBook Pro M1 Trackpads
- [BUG] HOT 2
- [FEAT] move the joystick(UI) from a gamepad contorller
- How to set the direction of nipplejs. HOT 2
- [FEAT] Provide nipple.esm.js in dist
- Multi touch issue on swipe [BUG]
- [BUG] Right-to-left issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nipplejs.