Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(var i = 0, data, sens; i < series.length; i++){
- if(!series[i].mouse.track) continue;
- data = series[i].data;
- sens = (series[i].mouse.sensibility*series[i].mouse.sensibility);
- for(var j = 0, xpow, ypow; j < data.length; j++){
- xpow = Math.pow(hozScale*(data[j][0] - mouse.x), 2);
- ypow = Math.pow(vertScale*(data[j][1] - mouse.y), 2);
- if(xpow < sens && ypow < sens && Math.sqrt(xpow+ypow) < n.dist){
- n.dist = Math.sqrt(xpow+ypow);
- n.x = data[j][0];
- n.y = data[j][1];
- n.mouse = series[i].mouse;
- }
- }
- }
Add Comment
Please, Sign In to add comment