From c3c458b6c17d86e3509cf620be9783a917b1a978 Mon Sep 17 00:00:00 2001 From: Somnath Mishra Date: Mon, 23 Oct 2023 18:02:47 +0000 Subject: [PATCH] Throwing error in webgl mode when using gridOutput() and textOutput() --- src/accessibility/gridOutput.js | 4 ++++ src/accessibility/textOutput.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/accessibility/gridOutput.js b/src/accessibility/gridOutput.js index e0a62ddbef..5e91133c6a 100644 --- a/src/accessibility/gridOutput.js +++ b/src/accessibility/gridOutput.js @@ -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) { + throw new Error('gridOutput() is not supported in WEBGL mode.'); + } //if html structure is not there yet if (!this.dummyDOM.querySelector(`#${idT}_summary`)) { return; diff --git a/src/accessibility/textOutput.js b/src/accessibility/textOutput.js index 5e37fd5781..09f030fc3d 100644 --- a/src/accessibility/textOutput.js +++ b/src/accessibility/textOutput.js @@ -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;