Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round shown var layer height to 0.01, show height in double slider. #10298

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/slic3r/GUI/DoubleSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,13 @@ wxString Control::get_label(int tick, LabelType label_type/* = ltHeightWithLayer
return str;
if (label_type == ltHeightWithLayer) {
size_t layer_number = m_is_wipe_tower ? get_layer_number(value, label_type) + 1 : (m_values.empty() ? value : value + 1);
return format_wxstr("%1%\n(%2%)", str, layer_number);
double layer_height = m_values.empty() ? m_label_koef : m_values[layer_number - 1] - (layer_number > 1 ? m_values[layer_number - 2] : 0);

//could be negative when custom G-code has layer height bigger than real one.
//Also could be less then real height when support not synchronized
if (layer_height <= 0)
layer_height = m_values[layer_number - 1];
return format_wxstr("%1%\n(%2%,\n%3%)", str, wxString::Format("%.2f", layer_height), layer_number);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/GLCanvas3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ std::string GLCanvas3D::LayersEditing::get_tooltip(const GLCanvas3D& canvas) con
}
}
if (h > 0.0f)
ret = std::to_string(h);
ret = wxString::Format("%.2f", h).ToStdString();
}
}
return ret;
Expand Down