Merge branch 'dev' into fs_mouse
# Conflicts: # src/slic3r/GUI/GLCanvas3D.cpp # src/slic3r/GUI/Gizmos/GLGizmoBase.cpp # src/slic3r/GUI/Gizmos/GLGizmoBase.hpp # src/slic3r/GUI/Gizmos/GLGizmoScale.cpp # src/slic3r/GUI/Gizmos/GLGizmoScale.hpp
This commit is contained in:
commit
f23c356507
293 changed files with 485348 additions and 48008 deletions
|
@ -116,7 +116,7 @@ void GLGizmoHollow::render_points(const Selection& selection, bool picking) cons
|
|||
glsafe(::glTranslated(0.0, 0.0, m_c->selection_info()->get_sla_shift()));
|
||||
glsafe(::glMultMatrixd(instance_matrix.data()));
|
||||
|
||||
std::array<float, 4> render_color;
|
||||
ColorRGBA render_color;
|
||||
const sla::DrainHoles& drain_holes = m_c->selection_info()->model_object()->sla_drain_holes;
|
||||
size_t cache_size = drain_holes.size();
|
||||
|
||||
|
@ -128,26 +128,18 @@ void GLGizmoHollow::render_points(const Selection& selection, bool picking) cons
|
|||
continue;
|
||||
|
||||
// First decide about the color of the point.
|
||||
if (picking) {
|
||||
std::array<float, 4> color = picking_color_component(i);
|
||||
render_color = color;
|
||||
}
|
||||
if (picking)
|
||||
render_color = picking_color_component(i);
|
||||
else {
|
||||
if (size_t(m_hover_id) == i) {
|
||||
render_color = {0.f, 1.f, 1.f, 1.f};
|
||||
}
|
||||
if (size_t(m_hover_id) == i)
|
||||
render_color = {0.0f, 1.0f, 1.0f, 1.0f};
|
||||
else if (m_c->hollowed_mesh() &&
|
||||
i < m_c->hollowed_mesh()->get_drainholes().size() &&
|
||||
m_c->hollowed_mesh()->get_drainholes()[i].failed) {
|
||||
render_color = {1.f, 0.f, 0.f, .5f};
|
||||
}
|
||||
else { // neigher hover nor picking
|
||||
|
||||
render_color[0] = point_selected ? 1.0f : 1.f;
|
||||
render_color[1] = point_selected ? 0.3f : 1.f;
|
||||
render_color[2] = point_selected ? 0.3f : 1.f;
|
||||
render_color[3] = 0.5f;
|
||||
render_color = {1.0f, 0.0f, 0.0f, 0.5f};
|
||||
}
|
||||
else // neither hover nor picking
|
||||
render_color = point_selected ? ColorRGBA(1.0f, 0.3f, 0.3f, 0.5f) : ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
}
|
||||
|
||||
const_cast<GLModel*>(&m_cylinder)->set_color(-1, render_color);
|
||||
|
@ -560,18 +552,11 @@ RENDER_AGAIN:
|
|||
}
|
||||
|
||||
m_imgui->disabled_begin(! m_enable_hollowing);
|
||||
float max_tooltip_width = ImGui::GetFontSize() * 20.0f;
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("offset"));
|
||||
ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x);
|
||||
ImGui::PushItemWidth(window_width - settings_sliders_left);
|
||||
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
m_imgui->slider_float("##offset", &offset, offset_min, offset_max, "%.1f mm", 1.0f, true, _L(opts[0].second->tooltip));
|
||||
#else
|
||||
m_imgui->slider_float("##offset", &offset, offset_min, offset_max, "%.1f mm");
|
||||
if (m_imgui->get_last_slider_status().hovered)
|
||||
m_imgui->tooltip((_utf8(opts[0].second->tooltip)).c_str(), max_tooltip_width);
|
||||
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
|
||||
bool slider_clicked = m_imgui->get_last_slider_status().clicked; // someone clicked the slider
|
||||
bool slider_edited =m_imgui->get_last_slider_status().edited; // someone is dragging the slider
|
||||
|
@ -581,13 +566,7 @@ RENDER_AGAIN:
|
|||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("quality"));
|
||||
ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x);
|
||||
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
m_imgui->slider_float("##quality", &quality, quality_min, quality_max, "%.1f", 1.0f, true, _L(opts[1].second->tooltip));
|
||||
#else
|
||||
m_imgui->slider_float("##quality", &quality, quality_min, quality_max, "%.1f");
|
||||
if (m_imgui->get_last_slider_status().hovered)
|
||||
m_imgui->tooltip((_utf8(opts[1].second->tooltip)).c_str(), max_tooltip_width);
|
||||
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
|
||||
slider_clicked |= m_imgui->get_last_slider_status().clicked;
|
||||
slider_edited |= m_imgui->get_last_slider_status().edited;
|
||||
|
@ -598,13 +577,7 @@ RENDER_AGAIN:
|
|||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("closing_distance"));
|
||||
ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x);
|
||||
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
m_imgui->slider_float("##closing_distance", &closing_d, closing_d_min, closing_d_max, "%.1f mm", 1.0f, true, _L(opts[2].second->tooltip));
|
||||
#else
|
||||
m_imgui->slider_float("##closing_distance", &closing_d, closing_d_min, closing_d_max, "%.1f mm");
|
||||
if (m_imgui->get_last_slider_status().hovered)
|
||||
m_imgui->tooltip((_utf8(opts[2].second->tooltip)).c_str(), max_tooltip_width);
|
||||
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
|
||||
slider_clicked |= m_imgui->get_last_slider_status().clicked;
|
||||
slider_edited |= m_imgui->get_last_slider_status().edited;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue