Gizmo measure - Revert of 7b569c4eb7 and renaming of distances shown in imgui dialog

This commit is contained in:
enricoturri1966 2022-12-14 08:57:13 +01:00
parent 24366c6294
commit 4979f9e36a

View File

@ -2045,17 +2045,18 @@ void GLGizmoMeasure::on_render_input_window(float x, float y, float bottom_limit
if (use_inches) if (use_inches)
distance = ObjectManipulation::mm_to_in * distance; distance = ObjectManipulation::mm_to_in * distance;
ImGui::PushID("ClipboardDistanceInfinite"); ImGui::PushID("ClipboardDistanceInfinite");
add_measure_row_to_table(_u8L("Distance"), ImGuiWrapper::COL_ORANGE_LIGHT, format_double(distance) + units, add_measure_row_to_table(_u8L("Perpendicular distance"), ImGuiWrapper::COL_ORANGE_LIGHT, format_double(distance) + units,
ImGui::GetStyleColorVec4(ImGuiCol_Text)); ImGui::GetStyleColorVec4(ImGuiCol_Text));
++measure_row_count; ++measure_row_count;
ImGui::PopID(); ImGui::PopID();
} }
if (measure.distance_strict.has_value() && !measure.distance_infinite.has_value()) { if (measure.distance_strict.has_value() &&
(!measure.distance_infinite.has_value() || std::abs(measure.distance_strict->dist - measure.distance_infinite->dist) > EPSILON)) {
double distance = measure.distance_strict->dist; double distance = measure.distance_strict->dist;
if (use_inches) if (use_inches)
distance = ObjectManipulation::mm_to_in * distance; distance = ObjectManipulation::mm_to_in * distance;
ImGui::PushID("ClipboardDistanceStrict"); ImGui::PushID("ClipboardDistanceStrict");
add_measure_row_to_table(_u8L("Distance"), ImGuiWrapper::COL_ORANGE_LIGHT, format_double(distance) + units, add_measure_row_to_table(_u8L("Direct distance"), ImGuiWrapper::COL_ORANGE_LIGHT, format_double(distance) + units,
ImGui::GetStyleColorVec4(ImGuiCol_Text)); ImGui::GetStyleColorVec4(ImGuiCol_Text));
++measure_row_count; ++measure_row_count;
ImGui::PopID(); ImGui::PopID();