From 9a0d3cb1fff242358e37b33f78bda7c00a5ca960 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 14 Dec 2022 12:15:37 +0100 Subject: [PATCH] Follow-up of 4979f9e36a322a18f8bd35d2eb5ddd299568bc5d - Gizmo measure - Another distance renaming --- src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index eb1fd8f14..ed9e2d078 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -2040,18 +2040,21 @@ void GLGizmoMeasure::on_render_input_window(float x, float y, float bottom_limit ++measure_row_count; ImGui::PopID(); } + + const bool show_strict = measure.distance_strict.has_value() && + (!measure.distance_infinite.has_value() || std::abs(measure.distance_strict->dist - measure.distance_infinite->dist) > EPSILON); + if (measure.distance_infinite.has_value()) { double distance = measure.distance_infinite->dist; if (use_inches) distance = ObjectManipulation::mm_to_in * distance; ImGui::PushID("ClipboardDistanceInfinite"); - add_measure_row_to_table(_u8L("Perpendicular distance"), ImGuiWrapper::COL_ORANGE_LIGHT, format_double(distance) + units, + add_measure_row_to_table(show_strict ? _u8L("Perpendicular distance") : _u8L("Distance"), ImGuiWrapper::COL_ORANGE_LIGHT, format_double(distance) + units, ImGui::GetStyleColorVec4(ImGuiCol_Text)); ++measure_row_count; ImGui::PopID(); } - if (measure.distance_strict.has_value() && - (!measure.distance_infinite.has_value() || std::abs(measure.distance_strict->dist - measure.distance_infinite->dist) > EPSILON)) { + if (show_strict) { double distance = measure.distance_strict->dist; if (use_inches) distance = ObjectManipulation::mm_to_in * distance;