hello guys
Working on a project with p5js and getting a curious result with mouseX and mouseY
So I have this code:
if(tx > 0 && tx < 500 && ty > 0 && ty < 500 && myp5.mouseIsPressed && (pty != ty || ptx != tx)){
socket.emit('message',{x : tx, y : ty, pen: 1});
pendown = true;
console.log(myp5.mouseX + "---" + myp5.mouseY);
}else{
if(pendown){
pendown = false;
socket.emit('message',{x : tx, y : ty, pen: 0});
console.log(tx + "---" + ty + "---up" );
}
}
and returns me this :
402.578125—436.5—up
java.js:14 392.578125—442.5
java.js:14 386.578125—445.5
java.js:20 386.578125—445.5—up
java.js:14 380.578125—447.5
java.js:14 373.578125—448.5
java.js:20 373.578125—448.5—up
java.js:14 365.578125—450.5
java.js:20 365.578125—450.5—up
java.js:14 358.578125—452.5
java.js:20 358.578125—452.5—up
java.js:14 352.578125—452.5
java.js:20 352.578125—452.5—up
java.js:14 347.578125—452.5
java.js:20 347.578125—452.5—up
why is the X with much more resolution and Y ? is this normal ?
thanks