From 77d6ebc1266dbf80061cc72606f1cc2f1b593442 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Wed, 24 Oct 2018 14:12:33 +0200 Subject: [PATCH] Rotate gizmo -> Grabbers showing tooltip also on hover for single instance selection. --- src/slic3r/GUI/GLGizmo.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLGizmo.cpp b/src/slic3r/GUI/GLGizmo.cpp index 0cf34436d..c6740abc3 100644 --- a/src/slic3r/GUI/GLGizmo.cpp +++ b/src/slic3r/GUI/GLGizmo.cpp @@ -445,10 +445,22 @@ void GLGizmoRotate::on_render(const BoundingBoxf3& box) const #if ENABLE_EXTENDED_SELECTION const BoundingBoxf3& box = selection.get_bounding_box(); -#endif // ENABLE_EXTENDED_SELECTION + bool single_instance = selection.is_single_full_instance(); + std::string axis; + switch (m_axis) + { + case X: { axis = "X: "; break; } + case Y: { axis = "Y: "; break; } + case Z: { axis = "Z: "; break; } + } + + if ((single_instance && (m_hover_id == 0)) || m_dragging) + set_tooltip(axis + format((float)Geometry::rad2deg(m_angle), 4) + "°"); +#else if (m_dragging) set_tooltip(format(m_angle * 180.0f / (float)PI, 4)); +#endif // ENABLE_EXTENDED_SELECTION else { m_center = box.center();