changeset 10568:046b713d21dc

__go_draw_figure__.m: Hidden axes may have visible children.
author Ben Abbott <bpabbott@mac.com>
date Sun, 25 Apr 2010 10:04:52 -0400
parents 79410269cd21
children 4f2e46473153
files scripts/ChangeLog scripts/plot/__go_draw_figure__.m
diffstat 2 files changed, 39 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Sat Apr 24 19:48:36 2010 -0400
+++ b/scripts/ChangeLog	Sun Apr 25 10:04:52 2010 -0400
@@ -1,3 +1,7 @@
+2010-04-25  Ben Abbott <bpabbot@mac.com>
+
+	* plot/__go_draw_figure__.m: Hidden axes may have visible children.
+
 2010-04-24  Ben Abbott <bpabbott@mac.com>
 
 	* plot/print.m: Set figure color property to 'none' when printing.
--- a/scripts/plot/__go_draw_figure__.m	Sat Apr 24 19:48:36 2010 -0400
+++ b/scripts/plot/__go_draw_figure__.m	Sun Apr 25 10:04:52 2010 -0400
@@ -77,43 +77,41 @@
           bg_is_set = false;
         endif
         for i = nkids:-1:1
-          if (strcmp (get (kids(i), "visible"), "on"))
-            type = get (kids(i), "type");
-            switch (type)
-              case "axes"
-                ## Rely upon listener to convert axes position to "normalized" units.
-                orig_axes_units = get (kids(i), "units");
-                orig_axes_position = get (kids(i), "position");
-                unwind_protect
-                  set (kids(i), "units", "normalized");
-                  fg = get (kids(i), "color");
-                  if (isnumeric (fg))
-                    fprintf (plot_stream, "set obj 2 rectangle from graph 0,0 to graph 1,1 behind fc rgb \"#%02x%02x%02x\"\n", 255 * fg);
-                    fg_is_set = true;
-                  else
-                    fg_is_set = false;
-                  endif
-                  if (output_to_paper)
-                    axes_position_on_page = orig_axes_position .* paper_position([3, 4, 3 ,4]);
-                    axes_position_on_page(1:2) = axes_position_on_page(1:2) +  paper_position(1:2);
-                    set (kids(i), "position", axes_position_on_page);
-                    __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin, bg_is_set);
-                  else
-                    ## Return axes "units" and "position" back to their original values.
-                    __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin, bg_is_set);
-                  endif
-                  unwind_protect_cleanup
-                  set (kids(i), "units", orig_axes_units);
-                  set (kids(i), "position", orig_axes_position);
-                  bg_is_set = false;
-                  if (fg_is_set)
-                    fputs (plot_stream, "unset obj 2\n");
-                  endif
-                end_unwind_protect
-              otherwise
-                error ("__go_draw_figure__: unknown object class, %s", type);
-            endswitch
-          endif
+          type = get (kids(i), "type");
+          switch (type)
+            case "axes"
+              ## Rely upon listener to convert axes position to "normalized" units.
+              orig_axes_units = get (kids(i), "units");
+              orig_axes_position = get (kids(i), "position");
+              unwind_protect
+                set (kids(i), "units", "normalized");
+                fg = get (kids(i), "color");
+                if (isnumeric (fg) && strcmp (get (kids(i), "visible"), "on"))
+                  fprintf (plot_stream, "set obj 2 rectangle from graph 0,0 to graph 1,1 behind fc rgb \"#%02x%02x%02x\"\n", 255 * fg);
+                  fg_is_set = true;
+                else
+                  fg_is_set = false;
+                endif
+                if (output_to_paper)
+                  axes_position_on_page = orig_axes_position .* paper_position([3, 4, 3 ,4]);
+                  axes_position_on_page(1:2) = axes_position_on_page(1:2) +  paper_position(1:2);
+                  set (kids(i), "position", axes_position_on_page);
+                  __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin, bg_is_set);
+                else
+                  ## Return axes "units" and "position" back to their original values.
+                  __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin, bg_is_set);
+                endif
+                unwind_protect_cleanup
+                set (kids(i), "units", orig_axes_units);
+                set (kids(i), "position", orig_axes_position);
+                bg_is_set = false;
+                if (fg_is_set)
+                  fputs (plot_stream, "unset obj 2\n");
+                endif
+              end_unwind_protect
+            otherwise
+              error ("__go_draw_figure__: unknown object class, %s", type);
+          endswitch
         endfor
         fputs (plot_stream, "\nunset multiplot;\n");
       else