changeset 26374:b3a2ee31dd58 stable

movie.m: Don't change "visible" property of figure handle input. * movie.m: Remove call to figure(). Find axes handle from any figure handle passed in. Add semicolons to BIST tests.
author Rik <rik@octave.org>
date Wed, 02 Jan 2019 12:44:38 -0800
parents 5b4b46f7e9ec
children f1a8a4aac3d4 00f796120a6d
files scripts/image/movie.m
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/image/movie.m	Wed Jan 02 21:39:05 2019 +0100
+++ b/scripts/image/movie.m	Wed Jan 02 12:44:38 2019 -0800
@@ -67,8 +67,10 @@
     if (strcmp (typ, "axes"))
       hax = varargin{1};
     elseif (strcmp (typ, "figure"))
-      figure (varargin{1});
-      hax = gca ();
+      hax = get (varargin{1}, "currentaxes");
+      if (isempty (hax))
+        hax = axes ("parent", varargin{1});
+      endif
     else
       error ("movie: H must be a handle to an axes or figure");
     endif
@@ -244,15 +246,15 @@
 %!error <N must be a non-zero integer>
 %! movie (struct ("cdata", {[], []}, "colormap", []), [2.3 -6]);
 %!error <All elements N\(2:end\) must be valid indices into the MOV struct>
-%! movie (struct ("cdata", {[], []}, "colormap", []), [1 -1])
+%! movie (struct ("cdata", {[], []}, "colormap", []), [1 -1]);
 %!error <All elements N\(2:end\) must be valid indices into the MOV struct>
-%! movie (struct ("cdata", {[], []}, "colormap", []), [1 5])
+%! movie (struct ("cdata", {[], []}, "colormap", []), [1 5]);
 %!error <FPS must be a numeric scalar . 0>
-%! movie (struct ("cdata", {[], []}, "colormap", []), 1, "a")
+%! movie (struct ("cdata", {[], []}, "colormap", []), 1, "a");
 %!error <FPS must be a numeric scalar . 0>
-%! movie (struct ("cdata", {[], []}, "colormap", []), 1, [1 1])
+%! movie (struct ("cdata", {[], []}, "colormap", []), 1, [1 1]);
 %!error <FPS must be a numeric scalar . 0>
-%! movie (struct ("cdata", {[], []}, "colormap", []), 1, -1/12)
+%! movie (struct ("cdata", {[], []}, "colormap", []), 1, -1/12);
 %!error <empty image data at frame 1>
 %! hf = figure ("visible", "off");
 %! unwind_protect
@@ -263,7 +265,7 @@
 %!error <empty image data at frame 2>
 %! hf = figure ("visible", "off");
 %! unwind_protect
-%!   movie (struct ("cdata", {ones(2), []}, "colormap", []))
+%!   movie (struct ("cdata", {ones(2), []}, "colormap", []));
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect