changeset 24638:a3031d4967ce

Supply the OpenGL viewport setting for gl2ps_print context (bug #52940). * gl2ps-print.cc (gl2ps_print): Get the figure "position" property width and height to set the gl2ps_renderer's viewport before drawing. * __opengl_print__.m: Remove an early drawnow() that is no longer needed to inadvertently set the viewport now handled by above change.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Tue, 23 Jan 2018 19:22:44 -0600
parents 3d78a7eb5aa4
children 1c90b6d357ec
files libinterp/corefcn/gl2ps-print.cc scripts/plot/util/private/__opengl_print__.m
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-print.cc	Tue Jan 23 18:05:24 2018 -0800
+++ b/libinterp/corefcn/gl2ps-print.cc	Tue Jan 23 19:22:44 2018 -0600
@@ -1085,6 +1085,8 @@
 
     gl2ps_renderer rend (fp, term);
 
+    Matrix pos = fig.get ("position").matrix_value ();
+    rend.set_viewport (pos(2), pos(3));
     rend.draw (fig, stream);
 
     // Make sure buffered commands are finished!!!
--- a/scripts/plot/util/private/__opengl_print__.m	Tue Jan 23 18:05:24 2018 -0800
+++ b/scripts/plot/util/private/__opengl_print__.m	Tue Jan 23 19:22:44 2018 -0600
@@ -25,9 +25,6 @@
 
   dos_shell = (ispc () && ! isunix ());
 
-  set (0, "currentfigure", opts.figure);
-  drawnow ("expose");
-
   if (! isempty (opts.fig2dev_binary))
     ## fig2dev is prefered for conversion to emf
     fig2dev_devices = {"pstex", "mf", "emf"};