From 32c9e8b168277e0d916c2f1eb1b69d1dc0c34139 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 15 Mar 2019 10:15:23 +0100 Subject: [PATCH] A small fix of the gizmo grabbers picking --- src/slic3r/GUI/GLGizmo.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/GLGizmo.cpp b/src/slic3r/GUI/GLGizmo.cpp index e8e48b63c..359deed3a 100644 --- a/src/slic3r/GUI/GLGizmo.cpp +++ b/src/slic3r/GUI/GLGizmo.cpp @@ -252,13 +252,12 @@ std::array GLGizmoBase::picking_color_component(unsigned int id) const id = BASE - id; - std::array color; + if (m_group_id > -1) + id -= m_group_id; - color[0] = (float)((id >> 16) & 0xff) * INV_255; // red - color[1] = (float)((id >> 8) & 0xff) * INV_255; // green - color[2] = (float)(id & 0xff) * INV_255; // blue - - return color; + return std::array { (float)((id >> 16) & 0xff) * INV_255, // red + (float)((id >> 8) & 0xff) * INV_255, // green + (float)(id & 0xff) * INV_255}; // blue } void GLGizmoBase::render_grabbers(const BoundingBoxf3& box) const