# HG changeset patch # User David Bateman # Date 1288381618 -7200 # Node ID 36442102c340e3ff2ad3b779ca0ceda5f1d5615a # Parent 51ac3a08e53cf45a16a03d078970bdf3bf4f37c7 Fix treatment of facevertexcdata if facecolor is 'none' with the fltk backend diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2010-10-29 David Bateman + + * graphics.cc (octave_value patch::properties::get_color_data + (void) const): Don't call convert_data is the facevertexcdata + property is undefined or empty. + * gl-render.cc (void opengl_renderer::draw_patch + (const patch::properties &)): Set ec_mode to 0 if edgecolor is "none". + Set fc_mode to 0 if facecolor is "none". + 2010-10-29 Ben Abbott * gl-render.cc: Crop ticks, ticklabels, and gridlines for OpenGL diff --git a/src/gl-render.cc b/src/gl-render.cc --- a/src/gl-render.cc +++ b/src/gl-render.cc @@ -2449,13 +2449,15 @@ bool has_facecolor = false; bool has_facealpha = false; - int fc_mode = (props.facecolor_is_rgb () ? 0 : + int fc_mode = ((props.facecolor_is("none") + || props.facecolor_is_rgb ()) ? 0 : (props.facecolor_is("flat") ? 1 : 2)); int fl_mode = (props.facelighting_is ("none") ? 0 : (props.facelighting_is ("flat") ? 1 : 2)); int fa_mode = (props.facealpha_is_double () ? 0 : (props.facealpha_is ("flat") ? 1 : 2)); - int ec_mode = (props.edgecolor_is_rgb () ? 0 : + int ec_mode = ((props.edgecolor_is("none") + || props.edgecolor_is_rgb ()) ? 0 : (props.edgecolor_is("flat") ? 1 : 2)); int el_mode = (props.edgelighting_is ("none") ? 0 : (props.edgelighting_is ("flat") ? 1 : 2)); diff --git a/src/graphics.cc b/src/graphics.cc --- a/src/graphics.cc +++ b/src/graphics.cc @@ -4966,8 +4966,11 @@ octave_value patch::properties::get_color_data (void) const { - return convert_cdata (*this, get_facevertexcdata (), - cdatamapping_is ("scaled"), 2); + octave_value fvc = get_facevertexcdata(); + if (fvc.is_undefined () || fvc.is_empty ()) + return Matrix (); + else + return convert_cdata (*this, fvc,cdatamapping_is ("scaled"), 2); } // ---------------------------------------------------------------------