Whenever i retrieve mouseX and mouseY , mouseX returns as long decimal number and mouseY returns as a integer. (ex. [340.32472970811324, 350]).
This is quite annoying as it broke one of my functions.
Does anyone have any idea why it is doing this?
Whenever i retrieve mouseX and mouseY , mouseX returns as long decimal number and mouseY returns as a integer. (ex. [340.32472970811324, 350]).
This is quite annoying as it broke one of my functions.
Does anyone have any idea why it is doing this?
Which OS?
Do you have a new mouse driver or mouse?
You can int() the value of course
Which OS?
Ubuntu 18.04 , using chromium
Do you have a new mouse driver or mouse?
mouse is the same one it has always been , the OS might have updated driver i am not sure.
I did fix my issue with int() but it is just puzzling me why its a float for one and interger with the other.
Hello,
Can you provide a small example of code to demonstrate this?
I will try it here.
:)
I can just type [mouseX,mouseY] into the developer console, and i would get that result, it isnt limited to any part of the code
p5.js uses the underlying web API:s to calculate the value of mouseX
and mouseY
. Those API:s returns a double
floating-point value. In other words: this is expected behavior and works as intended.
A
double
floating point value, as redefined by the CSSOM View Module. Originally, this property was defined as along
integer.