mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 20:29:04 +08:00
Tech ENABLE_PREVIEW_LAYER_TIME - Show '< 1s' in place of '0s' in preview legend
This commit is contained in:
parent
b60a0fe3d3
commit
8f36002ebe
@ -3026,7 +3026,10 @@ void GCodeViewer::render_legend(float& legend_height)
|
|||||||
#if ENABLE_PREVIEW_LAYER_TIME
|
#if ENABLE_PREVIEW_LAYER_TIME
|
||||||
auto append_time_range = [append_item](const Extrusions::Range& range) {
|
auto append_time_range = [append_item](const Extrusions::Range& range) {
|
||||||
auto append_range_item = [append_item](int i, float value) {
|
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)
|
if (range.count == 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user