From 8f36002ebeb743b71b042f0b55ba56dd46956cd0 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 6 Sep 2021 14:59:22 +0200 Subject: [PATCH] Tech ENABLE_PREVIEW_LAYER_TIME - Show '< 1s' in place of '0s' in preview legend --- src/slic3r/GUI/GCodeViewer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 3d7d754274..2c5ef72a00 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -3026,7 +3026,10 @@ void GCodeViewer::render_legend(float& legend_height) #if ENABLE_PREVIEW_LAYER_TIME auto append_time_range = [append_item](const Extrusions::Range& range) { auto append_range_item = [append_item](int i, float value) { - append_item(EItemType::Rect, Range_Colors[i], get_time_dhms(value)); + std::string str_value = get_time_dhms(value); + if (str_value == "0s") + str_value = "< 1s"; + append_item(EItemType::Rect, Range_Colors[i], str_value); }; if (range.count == 1)