Here is an example that uses the constrain() function:
You can easily split the canvas in 1/2 and constrain the drawing area with constrain() and if statements.
It gets more complicated using constrain() with more canvases!
I will not help any further until you have edited (format and delete duplicate code) your original code.
You have a few very obvious errors that I can help with.
Please edit your posts:
- You posted your code twice. You posted your code twice.
- It is difficult to read unless formatted properly.
![]()
