changeset 17558:e48a22b94727

Don't plot NaN values in cdata (bug #40114). * libinterp/corefcn/gl-render.cc(draw_surface): Check colordata for NaNs in addition to x,y,z data and set clip() matrix appropriately.
author Rik <rik@octave.org>
date Thu, 03 Oct 2013 16:42:42 -0700
parents 58039875767d
children 636330292685
files libinterp/corefcn/gl-render.cc
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc	Thu Oct 03 16:56:36 2013 -0400
+++ b/libinterp/corefcn/gl-render.cc	Thu Oct 03 16:42:42 2013 -0700
@@ -1600,6 +1600,9 @@
 
   i1 = i2 = j1 = j2 = 0;
 
+  if ((fc_mode > 0 && fc_mode < 3) || ec_mode > 0)
+    c = props.get_color_data ().array_value ();
+
   boolMatrix clip (z.dims (), false);
 
   for (int i = 0; i < zr; i++)
@@ -1613,12 +1616,11 @@
             j1 = j;
 
           clip(i,j) = is_nan_or_inf (x(i1,j), y(i,j1), z(i,j));
+          if (fc_mode == 1 || fc_mode == 2)
+            clip(i,j) |= (xisnan (c(i,j)) || xisinf (c(i,j)));
         }
     }
 
-  if ((fc_mode > 0 && fc_mode < 3) || ec_mode > 0)
-    c = props.get_color_data ().array_value ();
-
   if (fa_mode > 0 || ea_mode > 0)
     {
       // FIXME: implement alphadata conversion