diff libinterp/corefcn/gl2ps-print.cc @ 22759:39f39eb4e476

Implement "linejoin" property (bug #48387) * configure.ac: test whether gl2psLineJoin function is available in gl2ps * graphics.in.h (line::properties): add "linejoin" property * gl-render.h (opengl_renderer::set_linejoin): new virtual method, does nothing by default. * gl-render.cc (opengl_renderer::draw_line): make use of "linejoin" property * gl-render.cc (opengl_renderer::draw_patch/suface): force "miter" line join * gl2ps-print.cc (gl2ps_renderer::set_linejoin): call gl2psLineJoin conditioned on HAVE_GL2PSLINEJOIN. * genpropdoc.m: document linejoin property.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Thu, 27 Oct 2016 09:24:58 +0200
parents 3a2b891d0b33
children 1444a65085ca
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-print.cc	Sun Nov 13 21:27:41 2016 -0800
+++ b/libinterp/corefcn/gl2ps-print.cc	Thu Oct 27 09:24:58 2016 +0200
@@ -124,6 +124,20 @@
         gl2psEnable (GL2PS_LINE_STIPPLE);
     }
 
+    void set_linejoin (const std::string& s)
+    {
+      octave::opengl_renderer::set_linejoin (s);
+      
+#if defined (HAVE_GL2PSLINEJOIN)
+      if (s == "round")
+        gl2psLineJoin (GL2PS_LINE_JOIN_ROUND);
+      else if (s == "miter")
+        gl2psLineJoin (GL2PS_LINE_JOIN_MITER);
+      else if (s == "chamfer")
+        gl2psLineJoin (GL2PS_LINE_JOIN_BEVEL);
+#endif
+    }
+
     void set_polygon_offset (bool on, float offset = 0.0f)
     {
       if (on)