# HG changeset patch # User Rik # Date 1398796798 25200 # Node ID 8969bd72144893c8b4e15f7fd45b4bd312e2e787 # Parent 26c87537ab42e5fa57d00e4cb9364149bc1d499a Fix Z-depth issues of patches and lines in 2-D plots (bug #40722). * gl-render.cc (draw_patch): Call patch_tesselator constructor with a negative Z-offset for glPolygonOffset to pull it forward of line objects at Z=0. diff -r 26c87537ab42 -r 8969bd721448 libinterp/corefcn/gl-render.cc --- a/libinterp/corefcn/gl-render.cc Sun Apr 27 23:22:33 2014 +0200 +++ b/libinterp/corefcn/gl-render.cc Tue Apr 29 11:39:58 2014 -0700 @@ -2278,7 +2278,7 @@ Matrix vv (1, 3, 0.0); Matrix cc; - Matrix nn(1, 3, 0.0); + Matrix nn (1, 3, 0.0); double aa = 1.0; vv(0) = v(idx,0); vv(1) = v(idx,1); @@ -2339,7 +2339,10 @@ glEnable (GL_LIGHTING); // FIXME: use __index__ property from patch object - patch_tesselator tess (this, fc_mode, fl_mode, 0); + // -1.25 chosen to provide sufficient Z-offset for + // 'layer' property of 2-D plots and not to provoke + // Z-fighting with tesselator outline. + patch_tesselator tess (this, fc_mode, fl_mode, -1.25); for (int i = 0; i < nf; i++) {