Mercurial > hg > octave-nkf
changeset 18320:2ed9498e4a74
Change diagonal of FaceColor interpolation for patch objects to match Matlab.
* gl-render.cc (draw_patch): Reverse order of vertices passed to OpenGL for
FaceColor tesselator.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 16 Jan 2014 21:44:07 -0800 |
parents | 4718af222d9d |
children | c8d6ca222bcc |
files | libinterp/corefcn/gl-render.cc |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc +++ b/libinterp/corefcn/gl-render.cc @@ -2337,6 +2337,14 @@ tess.begin_polygon (true); tess.begin_contour (); + // Add vertices in reverse order for Matlab compatibility + for (int j = count_f(i)-1; j > 0; j--) + { + vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep (); + + tess.add_vertex (vv->coords.fortran_vec (), vv); + } + if (count_f(i) > 0) { vertex_data::vertex_data_rep *vv = vdata[i].get_rep (); @@ -2367,14 +2375,6 @@ tess.add_vertex (vv->coords.fortran_vec (), vv); } - // Add remaining vertices. - for (int j = 1; j < count_f(i); j++) - { - vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep (); - - tess.add_vertex (vv->coords.fortran_vec (), vv); - } - tess.end_contour (); tess.end_polygon (); }