@@ -75,7 +75,6 @@ class Renderer2D extends Renderer {
75
75
}
76
76
// Set and return p5.Element
77
77
this . wrappedElt = new Element ( this . elt , this . _pInst ) ;
78
-
79
78
this . clipPath = null ;
80
79
}
81
80
@@ -178,9 +177,10 @@ class Renderer2D extends Renderer {
178
177
// create background rect
179
178
const color = this . _pInst . color ( ...args ) ;
180
179
181
- //accessible Outputs
182
- if ( this . _pInst . _addAccsOutput ( ) ) {
183
- this . _pInst . _accsBackground ( color . _getRGBA ( [ 255 , 255 , 255 , 255 ] ) ) ;
180
+ // Add accessible outputs if the method exists; on success,
181
+ // set the accessible output background to white.
182
+ if ( this . _pInst . _addAccsOutput ?. ( ) ) {
183
+ this . _pInst . _accsBackground ?. ( color . _getRGBA ( [ 255 , 255 , 255 , 255 ] ) ) ;
184
184
}
185
185
186
186
const newFill = color . toString ( ) ;
@@ -211,9 +211,10 @@ class Renderer2D extends Renderer {
211
211
const color = this . states . fillColor ;
212
212
this . _setFill ( color . toString ( ) ) ;
213
213
214
- //accessible Outputs
215
- if ( this . _pInst . _addAccsOutput ( ) ) {
216
- this . _pInst . _accsCanvasColors ( 'fill' , color . _getRGBA ( [ 255 , 255 , 255 , 255 ] ) ) ;
214
+ // Add accessible outputs if the method exists; on success,
215
+ // set the accessible output background to white.
216
+ if ( this . _pInst . _addAccsOutput ?. ( ) ) {
217
+ this . _pInst . _accsCanvasColors ?. ( 'fill' , color . _getRGBA ( [ 255 , 255 , 255 , 255 ] ) ) ;
217
218
}
218
219
}
219
220
@@ -222,9 +223,10 @@ class Renderer2D extends Renderer {
222
223
const color = this . states . strokeColor ;
223
224
this . _setStroke ( color . toString ( ) ) ;
224
225
225
- //accessible Outputs
226
- if ( this . _pInst . _addAccsOutput ( ) ) {
227
- this . _pInst . _accsCanvasColors ( 'stroke' , color . _getRGBA ( [ 255 , 255 , 255 , 255 ] ) ) ;
226
+ // Add accessible outputs if the method exists; on success,
227
+ // set the accessible output background to white.
228
+ if ( this . _pInst . _addAccsOutput ?. ( ) ) {
229
+ this . _pInst . _accsCanvasColors ?. ( 'stroke' , color . _getRGBA ( [ 255 , 255 , 255 , 255 ] ) ) ;
228
230
}
229
231
}
230
232
0 commit comments