Mercurial > octave
changeset 33179:ed176bb5f7e6 bytecode-interpreter
maint: Merge default to bytecode-interpreter.
author | Nicholas R. Jankowski <jankowski.nicholas@gmail.com> |
---|---|
date | Thu, 07 Mar 2024 21:19:52 -0500 |
parents | ded304f45769 (current diff) 4ec97d8770ff (diff) |
children | 8725e0726cd0 |
files | |
diffstat | 2 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/draw/patch.m Fri Mar 08 02:29:23 2024 +0100 +++ b/scripts/plot/draw/patch.m Thu Mar 07 21:19:52 2024 -0500 @@ -303,6 +303,24 @@ %! close (hf); %! end_unwind_protect +%!test <*65421> +%! hf = figure ("visible", "off"); +%! unwind_protect +%! h1 = patch ("Vertices",[0, 0; 0, 1; 1, 0;1, 1], ... +%! "Faces", [1, 2, 3; 2, 3, 4], "CData", 1); +%! h2 = patch ("Vertices",[0, 0; 0, 1; 1, 0;1, 1], "CData", 1, ... +%! "Faces", [1, 2, 3; 2, 3, 4]); +%! h1_data = get (h1); +%! h2_data = get (h2); +%! assert ({h1_data.xdata, h1_data.ydata}, ... +%! {[0, 0; 0, 1; 1, 1], [0, 1; 1, 0; 0, 1]}); +%! assert ({h1_data.xdata, h1_data.ydata}, {h2_data.xdata, h2_data.ydata}); +%! assert (h1_data.faces, [1, 2, 3; 4, 5, 6]); +%! assert (h1_data.faces, h2_data.faces); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + ## Test input validation %!error <invalid color specification C> patch (1, 1, 'x') %!error <invalid TrueColor data C> patch (1, 1, rand (1,2,3))
--- a/scripts/plot/draw/private/__patch__.m Fri Mar 08 02:29:23 2024 +0100 +++ b/scripts/plot/draw/private/__patch__.m Thu Mar 07 21:19:52 2024 -0500 @@ -176,6 +176,16 @@ args = varargin; endif + ## All args now Property/Value pairs. + ## Ensure geometry properties come before other properties (see bug #65421). + geom_props = {"xdata", "ydata", "zdata", "faces", "vertices"}; + geom_args = or (cellfun (@strcmpi, {args(1:2:end)}, geom_props, ... + "UniformOutput", false){:}); + neworder = zeros (size (args)); + neworder(1:2:end) = [find(geom_args), find(! geom_args)] * 2 - 1; + neworder(2:2:end) = neworder(1:2:end) + 1; + args = args(neworder); + if (isempty (p)) p = gca (); endif