Absoltelly Strange error

edited December 2016 in Questions about Code

Part of code: noStroke(); fill(#f1c40f); stroke(255); rect(0,0,width,height); stroke(80); line(0,0,width,height);


Important part: Line and rectangle from top left



  • Answer ✓

    Oh. Im sorry, I' beginner. I was using rectMode(CENTER) and i forgott about it.

  • @Meldiron -- Ah -- glad you figured it out!

    In larger code blocks, one way to avoid strange problems from rectMode() (or the other _Mode functions) is to use pushStyle() and popStyle() to isolate the rectMode only with the part of your code where you need to use it. All other code will then use the default mode, so you won't be surprised.

Sign In or Register to comment.