Last change
on this file since 21341 was 21341, checked in by Mathieu Morlighem, 8 years ago |
merged trunk-jpl and trunk for revision 21337
|
-
Property svn:executable
set to
*
|
File size:
1.1 KB
|
Line | |
---|
1 | %USING_HG2 Determine if the HG2 graphics engine is used
|
---|
2 | %
|
---|
3 | % tf = using_hg2(fig)
|
---|
4 | %
|
---|
5 | %IN:
|
---|
6 | % fig - handle to the figure in question.
|
---|
7 | %
|
---|
8 | %OUT:
|
---|
9 | % tf - boolean indicating whether the HG2 graphics engine is being used
|
---|
10 | % (true) or not (false).
|
---|
11 |
|
---|
12 | % 19/06/2015 - Suppress warning in R2015b; cache result for improved performance
|
---|
13 | % 06/06/2016 - Fixed issue #156 (bad return value in R2016b)
|
---|
14 |
|
---|
15 | function tf = using_hg2(fig)
|
---|
16 | persistent tf_cached
|
---|
17 | if isempty(tf_cached)
|
---|
18 | try
|
---|
19 | if nargin < 1, fig = figure('visible','off'); end
|
---|
20 | oldWarn = warning('off','MATLAB:graphicsversion:GraphicsVersionRemoval');
|
---|
21 | try
|
---|
22 | % This generates a [supressed] warning in R2015b:
|
---|
23 | tf = ~graphicsversion(fig, 'handlegraphics');
|
---|
24 | catch
|
---|
25 | tf = ~verLessThan('matlab','8.4'); % =R2014b
|
---|
26 | end
|
---|
27 | warning(oldWarn);
|
---|
28 | catch
|
---|
29 | tf = false;
|
---|
30 | end
|
---|
31 | if nargin < 1, delete(fig); end
|
---|
32 | tf_cached = tf;
|
---|
33 | else
|
---|
34 | tf = tf_cached;
|
---|
35 | end
|
---|
36 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.