From ae3beeb50a60631f4c6c67162d709d3ee34506a7 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 5 Sep 2022 08:57:49 +0200 Subject: [PATCH] Fixed warnings --- src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index 8fddf11ad..74a5c93f7 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -308,7 +308,6 @@ void GLGizmoMeasure::on_render() } } else if (is_hovering_on_locked_feature) { - auto default_callback = [](const Vec3f& v) { return v; }; auto position_on_feature = [this](int feature_type_id, const Camera& camera, std::function callback = nullptr) -> Vec3d { auto it = m_raycasters.find(feature_type_id); if (it != m_raycasters.end() && it->second != nullptr) { @@ -317,9 +316,11 @@ void GLGizmoMeasure::on_render() const Transform3d& trafo = it->second->get_transform(); bool res = it->second->get_raycaster()->closest_hit(m_mouse_pos, trafo, camera, p, n); assert(res); - if (callback) - p = callback(p); - return trafo * p.cast(); + if (res) { + if (callback) + p = callback(p); + return trafo * p.cast(); + } } return Vec3d::Zero(); };