Skip to content

Commit db03f79

Browse files
authored
Rectifying graph for mouseX signal
The mouseX signal is not properly drawn on the graph, xvals[i] is simply divided by 3 like in the case for mouseY, which is not the case, but instead, it should be mapped from "width" to "height/3" . Hence the line 49: point(i, map(xvals[i],0,width,0,height/3-1));
1 parent 9eb15fb commit db03f79

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/examples/Basics/Input/MouseSignals/MouseSignals.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void draw()
4646

4747
for(int i=1; i<width; i++) {
4848
stroke(255);
49-
point(i, xvals[i]/3);
49+
point(i, map(xvals[i],0,width,0,height/3-1));
5050
stroke(0);
5151
point(i, height/3+yvals[i]/3);
5252
stroke(255);

0 commit comments

Comments
 (0)