Merge branch 'master' of https://github.com/prusa3d/Slic3r
This commit is contained in:
commit
43ce5accc2
6 changed files with 36 additions and 18 deletions
|
@ -85,7 +85,8 @@ void ObjectSettings::update_settings_list()
|
||||||
#endif // __WXMSW__
|
#endif // __WXMSW__
|
||||||
btn->Bind(wxEVT_BUTTON, [opt_key, config, this](wxEvent &event) {
|
btn->Bind(wxEVT_BUTTON, [opt_key, config, this](wxEvent &event) {
|
||||||
config->erase(opt_key);
|
config->erase(opt_key);
|
||||||
wxTheApp->CallAfter([this]() {
|
wxGetApp().obj_list()->part_settings_changed();
|
||||||
|
wxTheApp->CallAfter([this]() {
|
||||||
wxWindowUpdateLocker noUpdates(m_parent);
|
wxWindowUpdateLocker noUpdates(m_parent);
|
||||||
update_settings_list();
|
update_settings_list();
|
||||||
m_parent->Layout();
|
m_parent->Layout();
|
||||||
|
|
|
@ -330,8 +330,12 @@ bool GLGizmoSlaSupports::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
|
||||||
m_canvas_width = m_parent.get_canvas_size().get_width();
|
m_canvas_width = m_parent.get_canvas_size().get_width();
|
||||||
m_canvas_height = m_parent.get_canvas_size().get_height();
|
m_canvas_height = m_parent.get_canvas_size().get_height();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
select_point(m_hover_id);
|
if (m_editing_mode_cache[m_hover_id].selected)
|
||||||
|
unselect_point(m_hover_id);
|
||||||
|
else
|
||||||
|
select_point(m_hover_id);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -791,6 +795,19 @@ void GLGizmoSlaSupports::select_point(int i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GLGizmoSlaSupports::unselect_point(int i)
|
||||||
|
{
|
||||||
|
m_editing_mode_cache[i].selected = false;
|
||||||
|
m_selection_empty = true;
|
||||||
|
for (const CacheEntry& ce : m_editing_mode_cache) {
|
||||||
|
if (ce.selected) {
|
||||||
|
m_selection_empty = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GLGizmoSlaSupports::editing_mode_discard_changes()
|
void GLGizmoSlaSupports::editing_mode_discard_changes()
|
||||||
{
|
{
|
||||||
|
|
|
@ -93,6 +93,7 @@ private:
|
||||||
NoPoints,
|
NoPoints,
|
||||||
};
|
};
|
||||||
void select_point(int i);
|
void select_point(int i);
|
||||||
|
void unselect_point(int i);
|
||||||
void editing_mode_apply_changes();
|
void editing_mode_apply_changes();
|
||||||
void editing_mode_discard_changes();
|
void editing_mode_discard_changes();
|
||||||
void editing_mode_reload_cache();
|
void editing_mode_reload_cache();
|
||||||
|
|
|
@ -340,13 +340,11 @@ bool ImGuiWrapper::want_any_input() const
|
||||||
|
|
||||||
void ImGuiWrapper::init_font()
|
void ImGuiWrapper::init_font()
|
||||||
{
|
{
|
||||||
const float font_size = m_font_size * m_style_scaling;
|
|
||||||
|
|
||||||
destroy_font();
|
destroy_font();
|
||||||
|
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
io.Fonts->Clear();
|
io.Fonts->Clear();
|
||||||
ImFont* font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/NotoSans-Regular.ttf").c_str(), font_size, nullptr, m_glyph_ranges);
|
ImFont* font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/NotoSans-Regular.ttf").c_str(), m_font_size, nullptr, m_glyph_ranges);
|
||||||
if (font == nullptr) {
|
if (font == nullptr) {
|
||||||
font = io.Fonts->AddFontDefault();
|
font = io.Fonts->AddFontDefault();
|
||||||
if (font == nullptr) {
|
if (font == nullptr) {
|
||||||
|
|
|
@ -45,8 +45,8 @@ public:
|
||||||
void new_frame();
|
void new_frame();
|
||||||
void render();
|
void render();
|
||||||
|
|
||||||
float scaled(float x) const { return x * m_font_size * m_style_scaling; }
|
float scaled(float x) const { return x * m_font_size; }
|
||||||
ImVec2 scaled(float x, float y) const { return ImVec2(x * m_font_size * m_style_scaling, y * m_font_size * m_style_scaling); }
|
ImVec2 scaled(float x, float y) const { return ImVec2(x * m_font_size, y * m_font_size); }
|
||||||
ImVec2 calc_text_size(const wxString &text);
|
ImVec2 calc_text_size(const wxString &text);
|
||||||
|
|
||||||
void set_next_window_pos(float x, float y, int flag);
|
void set_next_window_pos(float x, float y, int flag);
|
||||||
|
|
|
@ -108,21 +108,26 @@ void Selection::add(unsigned int volume_idx, bool as_single_selection)
|
||||||
if (is_wipe_tower() && volume->is_wipe_tower)
|
if (is_wipe_tower() && volume->is_wipe_tower)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool keep_instance_mode = (m_mode == Instance) && !as_single_selection && (is_single_full_instance() || is_multiple_full_instance());
|
||||||
|
|
||||||
// resets the current list if needed
|
// resets the current list if needed
|
||||||
bool needs_reset = as_single_selection;
|
bool needs_reset = as_single_selection;
|
||||||
needs_reset |= volume->is_wipe_tower;
|
needs_reset |= volume->is_wipe_tower;
|
||||||
needs_reset |= is_wipe_tower() && !volume->is_wipe_tower;
|
needs_reset |= is_wipe_tower() && !volume->is_wipe_tower;
|
||||||
needs_reset |= !is_modifier() && volume->is_modifier;
|
needs_reset |= !keep_instance_mode && !is_modifier() && volume->is_modifier;
|
||||||
needs_reset |= is_modifier() && !volume->is_modifier;
|
needs_reset |= is_modifier() && !volume->is_modifier;
|
||||||
|
|
||||||
if (needs_reset)
|
if (needs_reset)
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
if (!contains_volume(volume_idx))
|
if (!contains_volume(volume_idx))
|
||||||
m_mode = volume->is_modifier ? Volume : Instance;
|
{
|
||||||
|
if (!keep_instance_mode)
|
||||||
|
m_mode = volume->is_modifier ? Volume : Instance;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
// keep current mode
|
// keep current mode
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (m_mode)
|
switch (m_mode)
|
||||||
{
|
{
|
||||||
|
@ -1142,16 +1147,12 @@ void Selection::_update_type()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modifiers_count == 0)
|
if (modifiers_count == 0)
|
||||||
{
|
|
||||||
m_type = MultipleVolume;
|
m_type = MultipleVolume;
|
||||||
requires_disable = true;
|
|
||||||
}
|
|
||||||
else if (modifiers_count == (unsigned int)m_list.size())
|
else if (modifiers_count == (unsigned int)m_list.size())
|
||||||
{
|
|
||||||
m_type = MultipleModifier;
|
m_type = MultipleModifier;
|
||||||
requires_disable = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
requires_disable = true;
|
||||||
}
|
}
|
||||||
else if ((selected_instances_count > 1) && (selected_instances_count * volumes_count == (unsigned int)m_list.size()))
|
else if ((selected_instances_count > 1) && (selected_instances_count * volumes_count == (unsigned int)m_list.size()))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue