From ada6dba00b8ff33be8087bbe276856a2742bc6ef Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 7 Sep 2018 12:20:56 +0200 Subject: [PATCH] Selection of picking color for gizmo grabber moved into GLGizmoBase --- xs/src/slic3r/GUI/GLGizmo.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/xs/src/slic3r/GUI/GLGizmo.cpp b/xs/src/slic3r/GUI/GLGizmo.cpp index 1c0456fa8..75d818a55 100644 --- a/xs/src/slic3r/GUI/GLGizmo.cpp +++ b/xs/src/slic3r/GUI/GLGizmo.cpp @@ -199,8 +199,11 @@ void GLGizmoBase::render_grabbers() const void GLGizmoBase::render_grabbers_for_picking() const { - for (int i = 0; i < (int)m_grabbers.size(); ++i) + for (unsigned int i = 0; i < (unsigned int)m_grabbers.size(); ++i) { + m_grabbers[i].color[0] = 1.0f; + m_grabbers[i].color[1] = 1.0f; + m_grabbers[i].color[2] = picking_color_component(i); m_grabbers[i].render_for_picking(); } } @@ -335,12 +338,8 @@ void GLGizmoRotate::on_render_for_picking(const BoundingBoxf3& box) const ::glDisable(GL_DEPTH_TEST); ::glPushMatrix(); + transform_to_local(); - - m_grabbers[0].color[0] = 1.0f; - m_grabbers[0].color[1] = 1.0f; - m_grabbers[0].color[2] = picking_color_component(0); - render_grabbers_for_picking(); ::glPopMatrix(); @@ -815,13 +814,6 @@ void GLGizmoScale3D::on_render_for_picking(const BoundingBoxf3& box) const { ::glDisable(GL_DEPTH_TEST); - for (unsigned int i = 0; i < (unsigned int)m_grabbers.size(); ++i) - { - m_grabbers[i].color[0] = 1.0f; - m_grabbers[i].color[1] = 1.0f; - m_grabbers[i].color[2] = picking_color_component(i); - } - render_grabbers_for_picking(); }