From 7eabf618937020c749d2d7109fad2298bc0c972b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Sun, 13 Oct 2024 16:11:48 +0200 Subject: [PATCH] legend.m: Overhaul test with transparency (bug #66314). * scripts/plot/appearance/legend.m: Simplify test by using "findobj". Skip test for graphics toolkit "gnuplot". --- scripts/plot/appearance/legend.m | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/plot/appearance/legend.m b/scripts/plot/appearance/legend.m index 9259550230..5cf410bc49 100644 --- a/scripts/plot/appearance/legend.m +++ b/scripts/plot/appearance/legend.m @@ -2279,16 +2279,14 @@ function update_legend_position (hl, sz) ## Verify alpha parameter inherited by legend patch objects. ## Only facealpha currently implemented. -%!test <*66314> +%!testif ; any (strcmp (graphics_toolkit (), {"fltk", "qt"})) <*66314> %! hf = figure ("visible", "off"); %! unwind_protect %! hax = axes ("parent", hf); %! hp = patch (hax); %! set (hp, "facealpha", 0.5); -%! hleg = legend (hax); -%! legprops = get(hleg); -%! legpatchidx = find (strcmp (get (legprops.children, "type"), "patch")); -%! assert (get (legprops.children(legpatchidx), "facealpha"), 0.5); +%! hl = legend (hax); +%! assert (get (findobj (hl, "type", "patch"), "facealpha"), 0.5); %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect