changeset 29204:21dddfdaa636 stable

hgsave.m: Allow test to run with qt or gnuplot graphics toolkits (bug #57241). * scripts/plot/util/hgsave.m: Allow test to run with qt or gnuplot graphics toolkits.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Fri, 18 Dec 2020 21:47:18 +0100
parents 9ec07d894070
children 5749eec4e2f2 dd0ad2409ef7
files scripts/plot/util/hgsave.m
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/hgsave.m	Fri Dec 18 21:09:55 2020 +0100
+++ b/scripts/plot/util/hgsave.m	Fri Dec 18 21:47:18 2020 +0100
@@ -90,12 +90,9 @@
 endfunction
 
 
-## FIXME: Have to use gnuplot for printing figs that have never been visible.
-%!testif HAVE_MAGICK; any (strcmp ("gnuplot", available_graphics_toolkits ()))
-%! toolkit = graphics_toolkit ();
-%! graphics_toolkit ("gnuplot");
+%!testif HAVE_MAGICK; (have_window_system () && __have_feature__ ("QT_OFFSCREEN") && strcmp ("qt", graphics_toolkit ())) || strcmp ("gnuplot", graphics_toolkit ());
+%! h1 = figure ("visible", "off", "paperposition", [0.25, 2.5, 8.0, 6.0]);
 %! unwind_protect
-%!   h1 = figure ("visible", "off", "paperposition", [0.25, 2.5, 8.0, 6.0]);
 %!   x = 0:0.1:2*pi;
 %!   y1 = sin (x);
 %!   y2 = exp (x - 1);
@@ -130,7 +127,6 @@
 %! unwind_protect_cleanup
 %!   close (h1);
 %!   close (h2);
-%!   graphics_toolkit (toolkit);
 %! end_unwind_protect
 
 ## Test input validation