Skip to content

Commit

Permalink
legend.m: Overhaul test with transparency (bug #66314).
Browse files Browse the repository at this point in the history
* scripts/plot/appearance/legend.m: Simplify test by using "findobj". Skip test
for graphics toolkit "gnuplot".
  • Loading branch information
mmuetzel committed Oct 13, 2024
1 parent 97b6713 commit 7eabf61
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/plot/appearance/legend.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7eabf61

Please sign in to comment.