Skip to content

Commit

Permalink
Round and show layer height
Browse files Browse the repository at this point in the history
  • Loading branch information
Vova authored and supermerill committed Jan 6, 2023
1 parent 586dac0 commit b324f4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/slic3r/GUI/DoubleSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,8 @@ 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);
return format_wxstr("%1%\n(%2%,\n%3%)", str, wxString::Format("%.*f", 2, layer_height), layer_number);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/slic3r/GUI/GLCanvas3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,12 @@ std::string GLCanvas3D::LayersEditing::get_tooltip(const GLCanvas3D& canvas) con
float dz = zi - zi_1;
h = (dz != 0.0f) ? static_cast<float>(lerp(m_layer_height_profile[i - 1], m_layer_height_profile[i + 1], (z - zi_1) / dz)) :
static_cast<float>(m_layer_height_profile[i + 1]);
h = check_z_step(h, m_slicing_parameters->z_step);
break;
}
}
if (h > 0.0f)
ret = std::to_string(h);
ret = wxString::Format("%.*f", 2, h).ToStdString();
}
}
return ret;
Expand Down

0 comments on commit b324f4d

Please sign in to comment.