Skip to content

Commit

Permalink
(3.39) Fixed exported bgcolor of uifigures or figures in Live Scripts…
Browse files Browse the repository at this point in the history
… (issue #377)
  • Loading branch information
altmany committed May 30, 2023
1 parent c2126db commit de3bc78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions export_fig.m
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@
% 13/04/23: (3.36) Reduced (hopefully fixed) unintended EPS/PDF image cropping (issues #97, #318); clarified warning in case of PDF/EPS export of transparent patches (issues #94, #106, #108)
% 23/04/23: (3.37) Fixed run-time error with old Matlab releases (issue #374); -notify console message about exported image now displays black (STDOUT) not red (STDERR)
% 15/05/23: (3.38) Fixed endless recursion when using export_fig in Live Scripts (issue #375); don't warn about exportgraphics/copygraphics alternatives in deployed mode
% 30/05/23: (3.39) Fixed exported bgcolor of uifigures or figures in Live Scripts (issue #377)
%}

if nargout
Expand Down Expand Up @@ -422,7 +423,7 @@
[fig, options] = parse_args(nargout, fig, argNames, varargin{:});

% Check for newer version and exportgraphics/copygraphics compatibility
currentVersion = 3.38;
currentVersion = 3.39;
if options.version % export_fig's version requested - return it and bail out
imageData = currentVersion;
return
Expand Down Expand Up @@ -468,7 +469,9 @@
end
try
% Create an invisible legacy figure at the same position/size as the uifigure
hNewFig = figure('Units',hFig.Units, 'Position',hFig.Position, 'MenuBar','none', 'ToolBar','none', 'Visible','off');
hNewFig = figure('Visible','off', 'Color',hFig.Color, ...
'Units',hFig.Units, 'Position',hFig.Position, ...
'MenuBar','none', 'ToolBar','none');
% Copy the uifigure contents onto the new invisible legacy figure
try
hChildren = allchild(hFig); %=uifig.Children;
Expand Down

0 comments on commit de3bc78

Please sign in to comment.