@@ -308,16 +308,24 @@ function fontWeight(hUIElement, weight)
308
308
widgetID = arrayfun(@(x )WidgetID(mlapptools .DEF_ID_ATTRIBUTE , x ), ...
309
309
string(tmp .id(contains(tmp .id , TAB_PREFIX ))));
310
310
case ' axes'
311
- switch subsref(ver(' matlab' ), substruct(' .' ,' Version' ))
312
- case {' 9.6' } % R2019a
313
- descendType = ' img' ;
314
- otherwise % R2016a-R2018b
311
+ switch true
312
+ case verLessThan(' matlab' ,' 9.0' ) % ver <= R2015b
313
+ throw(MException(' getWebElements:MATLABTooOld' ,...
314
+ ' MATLAB versions before R2016a are not supported!' ));
315
+ case verLessThan(' matlab' ,' 9.6' ) % R2016a-R2018b
315
316
descendType = ' canvas' ;
316
317
% This canvas has a context of type "webgl".
317
318
% See also: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API
318
319
warning([' UIAxes object detected. Returning the innermost <canvas> element. ' ...
319
320
' Be advised that mlapptools cannot modify this element, which ' ...
320
- ' instead requires using WebGL commands via `hWin.executeJS(...)`.' ]);
321
+ ' instead requires using WebGL commands via `hWin.executeJS(...)`.' ]);
322
+ case verLessThan(' matlab' ,' 9.7' ) % R2019a
323
+ descendType = ' img' ;
324
+ otherwise % R2019b-????
325
+ descendType = ' canvas' ;
326
+ widgetID = mlapptools .getDecendentOfType( ...
327
+ hWin , mlapptools .getDataTag(hUIElement .Parent ), descendType );
328
+ return
321
329
end
322
330
widgetID = mlapptools .getDecendentOfType( ...
323
331
hWin , mlapptools .getDataTag(hUIElement ), descendType );
0 commit comments