@@ -305,14 +305,19 @@ function fontWeight(hUIElement, weight)
305
305
widgetID = arrayfun(@(x )WidgetID(mlapptools .DEF_ID_ATTRIBUTE , x ), ...
306
306
string(tmp .id(contains(tmp .id , TAB_PREFIX ))));
307
307
case ' axes'
308
- % For uiaxes we return the <canvas> object. This canvas has a context
309
- % of type "webgl".
310
- % See also: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API
311
- warning([' UIAxes object detected. Returning the innermost <canvas> element. ' ...
308
+ switch subsref(ver(' matlab' ), substruct(' .' ,' Version' ))
309
+ case {' 9.6' } % R2019a
310
+ descendType = ' img' ;
311
+ otherwise % R2016a-R2018b
312
+ descendType = ' canvas' ;
313
+ % This canvas has a context of type "webgl".
314
+ % See also: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API
315
+ warning([' UIAxes object detected. Returning the innermost <canvas> element. ' ...
312
316
' Be advised that mlapptools cannot modify this element, which ' ...
313
- ' instead requires using WebGL commands via `hWin.executeJS(...)`.' ]);
317
+ ' instead requires using WebGL commands via `hWin.executeJS(...)`.' ]);
318
+ end
314
319
widgetID = mlapptools .getDecendentOfType( ...
315
- hWin , mlapptools .getDataTag(hUIElement ), ' canvas ' );
320
+ hWin , mlapptools .getDataTag(hUIElement ), descendType );
316
321
otherwise % default:
317
322
widgetID = mlapptools .getWidgetID(hWin , mlapptools .getDataTag(hUIElement ));
318
323
end
0 commit comments