Skip to content
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

Throwing friendly error in webgl mode when using gridOutput() and textOutput() #6491

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/accessibility/gridOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import p5 from '../core/main';

//updates gridOutput
p5.prototype._updateGridOutput = function(idT) {
// Check if the current rendering mode is WEBGL
if (this._renderer && this._renderer.isWEBGL) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now we don't have this property on renderers (although #5844 is open for it, it hasn't yet been merged.) For now I think maybe you can check if this._renderer instanceof p5.RendererGL to achieve the same thing.

throw new Error('gridOutput() is not supported in WEBGL mode.');
}
//if html structure is not there yet
if (!this.dummyDOM.querySelector(`#${idT}_summary`)) {
return;
Expand Down
4 changes: 4 additions & 0 deletions src/accessibility/textOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import p5 from '../core/main';

//updates textOutput
p5.prototype._updateTextOutput = function(idT) {
// Check if the current rendering mode is WEBGL
if (this._renderer.isWEBGL) {
throw new Error('textOutput() is not supported in WEBGL mode.');
}
//if html structure is not there yet
if (!this.dummyDOM.querySelector(`#${idT}_summary`)) {
return;
Expand Down