Commit 26cbafc0 authored by Thibault Soucarre's avatar Thibault Soucarre

corrected the visual bug in top left corner

parent 934628cd
......@@ -203,12 +203,13 @@ void Render_alternate::paintGL(){
_modelview = glm::translate(_modelview, glm::vec3(0.0, 0.0, _z_ruler));
mvp = _projection * _modelview;
glUniformMatrix4fv(glGetUniformLocation(_shader->getProgramID(), "MVP"), 1, GL_FALSE, glm::value_ptr(mvp));
/*The first 8 elements of the vbo are the coordinates of the quads, others elements are coordinates of the graduation*/
glDrawArrays(GL_QUADS, 0, 8);
_modelview = tmp;
_modelview = glm::translate(_modelview, glm::vec3(0.0, 0.0, _z_ruler_over));
mvp = _projection * _modelview;
glUniformMatrix4fv(glGetUniformLocation(_shader->getProgramID(), "MVP"), 1, GL_FALSE, glm::value_ptr(mvp));
glDrawArrays(GL_LINES, 8, _ruler.getNbVertex());
glDrawArrays(GL_LINES, 8, _ruler.getNbVertex()-8);
_ruler.unlock();
_modelview = tmp;
......@@ -708,16 +709,6 @@ void Render_alternate::draw_line(Element_pos x1, Element_pos y1, Element_pos x2,
_ruler.add(x1+offset_x, y1, _r, _g, _b);
_ruler.add(x2+offset_x, y2, _r, _g, _b);
}
else{
glBegin(GL_LINES);
{
glColor3d(_r, _g, _b);
glVertex3d(x1 + offset_x, y1 + offset_y, z);
glVertex3d(x2 + offset_x, y2 + offset_y, z);
}
glEnd();
}
}
void Render_alternate::draw_circle(Element_pos /*x*/, Element_pos /*y*/, Element_pos /*z*/, Element_pos /*r*/){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment