This example draws a circle as the cursor’s position but keeps the circle within a rectangle. It does so by passing the mouse’s coordinates into the constrain() function.
This example draws a circle as the cursor’s position but keeps the circle within a rectangle. It does so by passing the mouse’s coordinates into the constrain() function.