Skip to content

Commit 5a52ddd

Browse files
committed
Added handling for uiaxes in getWebElements
A canvas is now returned for a uiaxes input, along with a warning.
1 parent 6068af3 commit 5a52ddd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mlapptools.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,15 @@ function fontWeight(hUIElement, weight)
304304
[~,tmp] = mlapptools.getWidgetList( ancestor(hUIElement,'figure') );
305305
widgetID = arrayfun(@(x)WidgetID(mlapptools.DEF_ID_ATTRIBUTE, x), ...
306306
string(tmp.id(contains(tmp.id, TAB_PREFIX))));
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. '...
312+
'Be advised that mlapptools cannot modify this element, which '...
313+
'instead requires using WebGL commands via `hWin.executeJS(...)`.']);
314+
widgetID = mlapptools.getDecendentOfType( ...
315+
hWin, mlapptools.getDataTag(hUIElement), 'canvas');
307316
otherwise % default:
308317
widgetID = mlapptools.getWidgetID(hWin, mlapptools.getDataTag(hUIElement));
309318
end

0 commit comments

Comments
 (0)