# HG changeset patch # User Rik # Date 1329861845 28800 # Node ID 6b2448555bbd8edd17262ed14ff79eebdfb0f444 # Parent b5b49f400f9b57deb908324374ef09d76f869b3f 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. diff -r b5b49f400f9b -r 6b2448555bbd scripts/plot/private/__fltk_print__.m --- a/scripts/plot/private/__fltk_print__.m Mon Feb 20 13:41:50 2012 -0800 +++ b/scripts/plot/private/__fltk_print__.m Tue Feb 21 14:04:05 2012 -0800 @@ -148,6 +148,17 @@ opts.pipeline = pipeline; + ## Tell gl2ps to use different rendering options for 2D plots + haxes = findall (opts.figure, "type", "axes"); + vw = get (haxes, "view"); + if (iscell (v)) + vw = vertcat (vw{:}); + end + is2D = all (abs (vw(:,2)) == 90); + if (is2D) + gl2ps_device{end} = [gl2ps_device{end}, "is2D"]; + endif + for n = 1:numel(pipeline) if (opts.debug) fprintf ("fltk-pipeline: '%s'\n", pipeline{n}); diff -r b5b49f400f9b -r 6b2448555bbd src/gl2ps-renderer.cc --- 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