diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp index 8aca79910c6..89b9aed8077 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp @@ -181,7 +181,7 @@ void Scene_polyhedron_selection_item::draw(CGAL::Three::Viewer_interface* viewer program = getShaderProgram(PROGRAM_WITH_LIGHT); attrib_buffers(viewer,PROGRAM_WITH_LIGHT); program->bind(); - program->setAttributeValue("colors",facet_color); + program->setAttributeValue("colors",this->color()); viewer->glDrawArrays(GL_TRIANGLES, 0, static_cast(nb_facets/3)); program->release(); vaos[0]->release(); diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h index effd5e80084..b7feb6ab4ae 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h @@ -187,6 +187,7 @@ public: nb_facets = 0; nb_points = 0; nb_lines = 0; + this->setColor(facet_color); } Scene_polyhedron_selection_item(Scene_polyhedron_item* poly_item, QMainWindow* mw) @@ -207,6 +208,7 @@ public: buffers[i].create(); } init(poly_item, mw); + this->setColor(facet_color); invalidateOpenGLBuffers(); } diff --git a/Three/include/CGAL/Three/Scene_item.h b/Three/include/CGAL/Three/Scene_item.h index 89f4506487d..37eafaae201 100644 --- a/Three/include/CGAL/Three/Scene_item.h +++ b/Three/include/CGAL/Three/Scene_item.h @@ -298,7 +298,7 @@ public Q_SLOTS: //!Must be overloaded. virtual void invalidateOpenGLBuffers(); //!Setter for the color of the item. Calls invalidateOpenGLBuffers() so the new color is applied. - virtual void setColor(QColor c) { color_ = c; invalidateOpenGLBuffers(); } + virtual void setColor(QColor c) { color_ = c; if(!is_monochrome)invalidateOpenGLBuffers(); } //!Setter for the RGB color of the item. Calls setColor(QColor). //!@see setColor(QColor c) void setRbgColor(int r, int g, int b) { setColor(QColor(r, g, b)); }