diff src/gl2ps-renderer.cc @ 14389:6b2448555bbd

Fix Z-order stacking of axis background for FLTK printing (bug #35559) * __fltk_print__.m: Pass a 2D option to gl2ps renderer. * gl2ps-renderer.cc (draw): Switch sort order for passing objects to renderer based on 2D option.
author Rik <octave@nomad.inbox5.com>
date Tue, 21 Feb 2012 14:04:05 -0800
parents 81ee6b12adbc
children 933101fd5cbb
line wrap: on
line diff
--- a/src/gl2ps-renderer.cc	Mon Feb 20 13:41:50 2012 -0800
+++ b/src/gl2ps-renderer.cc	Tue Feb 21 14:04:05 2012 -0800
@@ -72,11 +72,15 @@
       GLint gl2ps_text = 0;
       if (term.find ("notxt") != std::string::npos) gl2ps_text = GL2PS_NO_TEXT;
 
+      // Default sort order optimizes for 3D plots
+      GLint gl2ps_sort = GL2PS_BSP_SORT;
+      if (term.find ("is2D") != std::string::npos) gl2ps_sort = GL2PS_NO_SORT;
+
       while (state == GL2PS_OVERFLOW)
         {
           buffsize += 1024*1024;
           gl2psBeginPage ("glps_renderer figure", "Octave", viewport,
-                          gl2ps_term, GL2PS_BSP_SORT,
+                          gl2ps_term, gl2ps_sort,
                           (GL2PS_SILENT | GL2PS_SIMPLE_LINE_OFFSET
                            | GL2PS_NO_BLENDING | GL2PS_OCCLUSION_CULL
                            | GL2PS_BEST_ROOT | gl2ps_text