changeset 28320:d4cabdf30b4a

Fix indexing error when printing figure without axes to raster format (bug #58395). * __print_parse_opts__.m: Check whether list of text object handles (ht) is non-empty before attempting to get "rotation" property from those handles.
author Guillaume Flandin <guillaume.offline@gmail.com>
date Mon, 18 May 2020 09:56:19 -0700
parents b81ff4104895
children db86874f8a6f
files scripts/plot/util/private/__print_parse_opts__.m
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/private/__print_parse_opts__.m	Mon May 18 12:42:17 2020 -0400
+++ b/scripts/plot/util/private/__print_parse_opts__.m	Mon May 18 09:56:19 2020 -0700
@@ -248,7 +248,11 @@
     if (opengl_ok && strcmp (graphics_toolkit (arg_st.figure), "qt"))
       ## "opengl" renderer only does text rotations of 0°, 90°, 180°, 270°, ...
       ht = findall (arg_st.figure, "type", "text");
-      angles = [get(ht, "rotation"){:}];
+      if (isempty (ht))
+        angles = [];
+      else
+        angles = [get(ht, "rotation"){:}];
+      endif
       if (any (mod (angles, 90)))
         arg_st.renderer = "painters";
       else