GCodeViewer -> Line width of toolpaths dependent on zoom

This commit is contained in:
enricoturri1966 2020-06-23 09:01:28 +02:00
parent ca7dce9f02
commit 779dcd58c8

View file

@ -870,8 +870,12 @@ void GCodeViewer::render_toolpaths() const
glsafe(::glDisable(GL_VERTEX_PROGRAM_POINT_SIZE));
};
auto line_width = [zoom]() {
return (zoom < 5.0) ? 1.0 : (1.0 + 5.0 * (zoom - 5.0) / (100.0 - 5.0));
};
glsafe(::glCullFace(GL_BACK));
glsafe(::glLineWidth(3.0f));
glsafe(::glLineWidth(static_cast<GLfloat>(line_width())));
unsigned char begin_id = buffer_id(GCodeProcessor::EMoveType::Retract);
unsigned char end_id = buffer_id(GCodeProcessor::EMoveType::Count);