Skip to content

Commit

Permalink
Added warning in case user requested anti-aliased output on an aliase…
Browse files Browse the repository at this point in the history
…d HG2 figure (issue #292)
  • Loading branch information
altmany committed Dec 12, 2019
1 parent 5b5a2a9 commit 926fbe8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion export_fig.m
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@
% 12/06/19: Issue #277: Enabled preservation of figure's PaperSize in output PDF/EPS file
% 06/08/19: Remove warning message about obsolete JavaFrame in R2019b
% 30/10/19: Fixed issue #261: added support for exporting uifigures and uiaxes (thanks to idea by @MarvinILA)
% 12/12/19: Added warning in case user requested anti-aliased output on an aliased HG2 figure (issue #292)
%}

if nargout
Expand Down Expand Up @@ -1344,10 +1345,13 @@
end

% Set default anti-aliasing now we know the renderer
try isAA = strcmp(get(ancestor(fig, 'figure'), 'GraphicsSmoothing'), 'on'); catch, isAA = false; end
if options.aa_factor == 0
try isAA = strcmp(get(ancestor(fig, 'figure'), 'GraphicsSmoothing'), 'on'); catch, isAA = false; end
options.aa_factor = 1 + 2 * (~(using_hg2(fig) && isAA) | (options.renderer == 3));
end
if options.aa_factor > 1 && ~isAA && using_hg2(fig)
warning('export_fig:AntiAliasing','You requested export_fig anti-aliased output of an aliased figure (''GraphicsSmoothing''=''off''). You will see better results if you set your figure''s GraphicsSmoothing property to ''on'' before calling export_fig.')
end

% Convert user dir '~' to full path
if numel(options.name) > 2 && options.name(1) == '~' && (options.name(2) == '/' || options.name(2) == '\')
Expand Down

0 comments on commit 926fbe8

Please sign in to comment.