Skip to content

table-text in accessibility options breaks sketch #3373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
prossel opened this issue Mar 7, 2025 · 5 comments
Closed

table-text in accessibility options breaks sketch #3373

prossel opened this issue Mar 7, 2025 · 5 comments
Labels

Comments

@prossel
Copy link

prossel commented Mar 7, 2025

p5.js version

1.11.1

What is your operating system?

Mac OS

Web browser and version

Firefox 135.0.1

Actual Behavior

This simple sketch is breaking if the table-text option in enabled in accessibility configuration.

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

function draw() {
  background(220);
  
  line(10, 10, 100, -100)
}

Here is the error message:

TypeError: cells[ingredients[x][y].loc.locY] is undefined
at undefined:53353:93

🌸 p5.js says:
[p5.js, line 53353] 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.11.1/p5.js:53353:93]
    Error at line 53353 in _gridMap()
    └[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js:53318:34]
    Called from line 53318 in [286]</_main.default.prototype._updateGridOutput()
    └[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js:53870:20]
    Called from line 53870 in [287]</_main.default.prototype._updateAccsOutput()
    └[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js:79142:22]
    Called from line 79142 in [318]</_main.default.prototype.redraw()
    └[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js:66335:23]
    Called from line 66335 in [306]</p5/this._draw()

Expected Behavior

No error, even with the table-text option enabled

Steps to reproduce

Steps:

  1. Open a new sketch on editor.p5js.org
  2. Pate the code below
  3. Enable the table-text option in Accessibility preferences
  4. Run and see the error

Snippet:

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

function draw() {
  background(220);
  
  line(10, 10, 100, -100)
}
@prossel prossel added the Bug label Mar 7, 2025
Copy link

welcome bot commented Mar 7, 2025

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

@RashiJyotishi
Copy link

I would like to work on this issue. Please assign it to me.

@takshittt
Copy link

The issue was that you were using a negative y-coordinate (-100) for the endpoint of your line. In p5.js, the coordinate system starts at the top-left corner (0,0), with positive y values going down.

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

function draw() {
background(220);

line(10, 10, 100, 100)
}`

@Jatin24062005
Copy link
Contributor

Hey @prossel, I looked into your issue and found that while it's valid, it is not related to this repository. The error you're encountering is caused by the accessibility feature and originates from the GridOutput.js file in p5.js.

It would be better to open this issue in the p5.js repository instead of here to ensure it gets addressed in the right place.

Since this issue is not relevant to this repository, I recommend closing it here.
Thanks for reporting this, and I appreciate your effort in bringing it to our attention

@prossel
Copy link
Author

prossel commented Mar 8, 2025

Thank you @Jatin24062005
The issue in p5.js repository is here:
processing/p5.js#7612

@prossel prossel closed this as completed Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants