diff options
author | enricoturri1966 <enricoturri@seznam.cz> | 2022-02-08 14:57:56 +0300 |
---|---|---|
committer | enricoturri1966 <enricoturri@seznam.cz> | 2022-02-08 14:57:56 +0300 |
commit | 92aa6540f57993936f595ccecbce5dd259100e30 (patch) | |
tree | 9417d0e685b35949962ede24547dafee518ab902 /src/slic3r/GUI/Selection.cpp | |
parent | f6c7fefec257fbc3150467c691e6d3027b971825 (diff) |
Tech ENABLE_SHOW_TOOLPATHS_COG - Show toolpaths center of gravity
Diffstat (limited to 'src/slic3r/GUI/Selection.cpp')
-rw-r--r-- | src/slic3r/GUI/Selection.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index c680f6e09..3ef0fcdd9 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -1276,6 +1276,14 @@ void Selection::render_center(bool gizmo_is_dragging) if (!m_valid || is_empty()) return; +#if ENABLE_GLBEGIN_GLEND_REMOVAL + GLShaderProgram* shader = wxGetApp().get_shader("flat"); + if (shader == nullptr) + return; + + shader->start_using(); +#endif // ENABLE_GLBEGIN_GLEND_REMOVAL + const Vec3d center = gizmo_is_dragging ? m_cache.dragging_center : get_bounding_box().center(); glsafe(::glDisable(GL_DEPTH_TEST)); @@ -1284,19 +1292,17 @@ void Selection::render_center(bool gizmo_is_dragging) glsafe(::glTranslated(center.x(), center.y(), center.z())); #if ENABLE_GLBEGIN_GLEND_REMOVAL - GLShaderProgram* shader = wxGetApp().get_shader("flat"); - if (shader == nullptr) - return; - - shader->start_using(); -#endif // ENABLE_GLBEGIN_GLEND_REMOVAL + m_vbo_sphere.set_color(ColorRGBA::WHITE()); +#else m_vbo_sphere.set_color(-1, ColorRGBA::WHITE()); +#endif // ENABLE_GLBEGIN_GLEND_REMOVAL m_vbo_sphere.render(); + + glsafe(::glPopMatrix()); + #if ENABLE_GLBEGIN_GLEND_REMOVAL shader->stop_using(); #endif // ENABLE_GLBEGIN_GLEND_REMOVAL - - glsafe(::glPopMatrix()); } #endif // ENABLE_RENDER_SELECTION_CENTER |