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

Mostly offscreen primitive shapes throws error

Open mimiyin opened this issue 1 year ago • 2 comments

Most appropriate sub-area of p5.js?

  • [ ] Accessibility
  • [ ] Color
  • [X] Core/Environment/Rendering
  • [ ] Data
  • [ ] DOM
  • [ ] Events
  • [ ] Image
  • [ ] IO
  • [ ] Math
  • [ ] Typography
  • [ ] Utilities
  • [ ] WebGL
  • [ ] Build process
  • [ ] Unit testing
  • [ ] Internationalization
  • [ ] Friendly errors
  • [ ] Other (specify if possible)

p5.js version

1.8.0+

Web browser and version

128.0.6613.86 (Official Build) (x86_64)

Operating system

MacOSX

Steps to reproduce this

Steps:

  1. Draw ellipse(400, 400, 400,400);

  2. Change the y-coordinate to 440

  3. Error

  4. Draw ellipse(400, 0, 400,400);

  5. Change the y-coordinate to -1

  6. Error

I was not able to repro with changes to the x-coordinate I was able to repro with line() and rect(). Errors go away with pre 1.8 versions.

Error: TypeError: Cannot read properties of undefined (reading '9') at undefined:52576:53

🌸 p5.js says: [p5.js, line 52576] Cannot read property of undefined. Check the line number in error and make sure the variable which is being operated is not undefined.

  • More info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong ┌[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.8.0/p5.js:52576:53] Error at line 52576 in _gridMap() └[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.8.0/p5.js:52541:26] Called from line 52541 in _main.default._updateGridOutput() └[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.8.0/p5.js:52977:20] Called from line 52977 in _main.default._updateAccsOutput() └[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.8.0/p5.js:71385:22] Called from line 71385 in _main.default.redraw() └[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.8.0/p5.js:62766:23] Called from line 62766 in _draw()

Snippet:

function setup() {
  createCanvas(400, 400);
}

function draw() {
  background(220);
  
  // No-Error
  ellipse(400, 0, 400,400);

//   // Error
//   ellipse(400, -1, 400,400);

//   // No-Error
//   ellipse(400, 400, 400,400);

//   // Error
//   ellipse(400, 440, 400,400);
}

mimiyin avatar Sep 09 '24 20:09 mimiyin