changeset 20069:42c3a0829324

Skip z axes rendering when in 2D mode (bug #44752) * gl-render.cc (opengl_renderer::draw_axes_boxes): skip z axes rendering when in 2D mode
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Mon, 06 Apr 2015 21:33:13 +0200
parents 490ae1d98f27
children f68c3a62e42c
files libinterp/corefcn/gl-render.cc
diffstat 1 files changed, 25 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc	Mon Apr 06 20:48:23 2015 +0100
+++ b/libinterp/corefcn/gl-render.cc	Mon Apr 06 21:33:13 2015 +0200
@@ -972,37 +972,40 @@
     }
 
   // Z box
-  set_color (props.get_zcolor_rgb ());
-
-  if (xySym)
-    {
-      glVertex3d (xPlaneN, yPlane, zPlaneN);
-      glVertex3d (xPlaneN, yPlane, zPlane);
-    }
-  else
+  if (! is2d)
     {
-      glVertex3d (xPlane, yPlaneN, zPlaneN);
-      glVertex3d (xPlane, yPlaneN, zPlane);
-    }
-
-  if (props.is_box ())
-    {
-      glVertex3d (xPlane, yPlane, zPlaneN);
-      glVertex3d (xPlane, yPlane, zPlane);
+      set_color (props.get_zcolor_rgb ());
 
       if (xySym)
         {
+          glVertex3d (xPlaneN, yPlane, zPlaneN);
+          glVertex3d (xPlaneN, yPlane, zPlane);
+        }
+      else
+        {
           glVertex3d (xPlane, yPlaneN, zPlaneN);
           glVertex3d (xPlane, yPlaneN, zPlane);
         }
-      else
+
+      if (props.is_box ())
         {
-          glVertex3d (xPlaneN, yPlane, zPlaneN);
-          glVertex3d (xPlaneN, yPlane, zPlane);
+          glVertex3d (xPlane, yPlane, zPlaneN);
+          glVertex3d (xPlane, yPlane, zPlane);
+
+          if (xySym)
+            {
+              glVertex3d (xPlane, yPlaneN, zPlaneN);
+              glVertex3d (xPlane, yPlaneN, zPlane);
+            }
+          else
+            {
+              glVertex3d (xPlaneN, yPlane, zPlaneN);
+              glVertex3d (xPlaneN, yPlane, zPlane);
+            }
+
+          glVertex3d (xPlaneN, yPlaneN, zPlaneN);
+          glVertex3d (xPlaneN, yPlaneN, zPlane);
         }
-
-      glVertex3d (xPlaneN, yPlaneN, zPlaneN);
-      glVertex3d (xPlaneN, yPlaneN, zPlane);
     }
 
   glEnd ();