processing / processing-sound

Audio library for Processing built with JSyn
https://processing.org/reference/libraries/sound/
GNU Lesser General Public License v2.1
149 stars 50 forks source link

Don't cause ArrayIndexOutOfBoundsException in some examples on Android. #34

Closed Calsign closed 5 years ago

Calsign commented 5 years ago

On Android, the mouse position can be outside the sketch bounds because Processing detects touch events for the entire screen, not just the sketch. This causes ArrayIndexOutOfBoundsException for the spectrum examples (NoiseSpectrum and OscillatorSpectrum), so added an extra check to prevent out of bounds access.

kevinstadler commented 5 years ago

Thank you, that's great!