p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

Typo on mouseWheel sample code

Open joaofnunes opened this issue 11 months ago • 2 comments

Most appropriate sections of the p5.js website?

Examples

What is your operating system?

Mac OS

Web browser and version

Brave: 1.73.104

Actual Behavior

In the first example of the mouseWheel function, the code is intended to draw a circle in the center of the canvas and increase the circle's size when the user scrolls the mouse wheel. However, the code contains a typo, as it mistakenly changes the circle's X coordinate instead.

// Draw the circle circle(circleSize, 50, 50);

Expected Behavior

// Draw the circle circle(50, 50, circleSize);

Steps to reproduce

No response

Would you like to work on the issue?

yes

joaofnunes avatar Jan 06 '25 11:01 joaofnunes

@joaofnunes Thanks for the report. The reference is written inline with the source code of p5.js so you will need to make the relevant changes over in https://github.com/processing/p5.js. I'll assign the issue to you.

limzykenneth avatar Jan 20 '25 20:01 limzykenneth

[@limzykenneth] i had fixed this in the given PR (https://github.com/processing/p5.js/pull/7614)

swastikCommits avatar Mar 09 '25 02:03 swastikCommits