FIX:Fix bugs caused by buried points

Change-Id: I47d4e786912120124c134404afce15dec48c7974
Signed-off-by: Kunlong Ma <kunlong.ma@bambulab.com>
This commit is contained in:
Kunlong Ma 2023-08-01 09:55:57 +08:00 committed by Lane.Wei
parent 80fb7c6d16
commit fcb7db2dde
3 changed files with 39 additions and 16 deletions

View file

@ -982,16 +982,16 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt)
update_on_off_state(mouse_pos); update_on_off_state(mouse_pos);
update_data(); update_data();
m_parent.set_as_dirty(); m_parent.set_as_dirty();
} try {
try { std::string name = get_name_from_gizmo_etype(m_hover);
std::string name = m_gizmos[m_hover]->get_gizmo_name(); int count = m_gizmos[m_hover]->get_count();
int count = m_gizmos[m_hover]->get_count(); NetworkAgent* agent = GUI::wxGetApp().getAgent();
NetworkAgent* agent = GUI::wxGetApp().getAgent(); if (agent) {
if (agent) { agent->track_update_property(name, std::to_string(count));
agent->track_update_property(name, std::to_string(count)); }
} }
catch (...) {}
} }
catch (...) {}
} }
else if (evt.MiddleDown()) { else if (evt.MiddleDown()) {
m_mouse_capture.middle = true; m_mouse_capture.middle = true;
@ -1685,5 +1685,28 @@ int GLGizmosManager::get_shortcut_key(GLGizmosManager::EType type) const
return m_gizmos[type]->get_shortcut_key(); return m_gizmos[type]->get_shortcut_key();
} }
std::string get_name_from_gizmo_etype(GLGizmosManager::EType type)
{
switch (type) {
case GLGizmosManager::EType::Move:
return "Move";
case GLGizmosManager::EType::Rotate:
return "Rotate";
case GLGizmosManager::EType::Scale:
return "Scale";
case GLGizmosManager::EType::Flatten:
return "Flatten";
case GLGizmosManager::EType::FdmSupports:
return "FdmSupports";
case GLGizmosManager::EType::Seam:
return "Seam";
case GLGizmosManager::EType::Text:
return "Text";
default:
return "";
}
return "";
}
} // namespace GUI } // namespace GUI
} // namespace Slic3r } // namespace Slic3r

View file

@ -328,7 +328,7 @@ private:
bool grabber_contains_mouse() const; bool grabber_contains_mouse() const;
}; };
std::string get_name_from_gizmo_etype(GLGizmosManager::EType type);
} // namespace GUI } // namespace GUI
} // namespace Slic3r } // namespace Slic3r

View file

@ -491,25 +491,25 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
j["custom_height"] = value; j["custom_height"] = value;
value = ""; value = "";
agent->track_get_property("Move", value); agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Move), value);
j["move"] = value; j["move"] = value;
value = ""; value = "";
agent->track_get_property("Rotate", value); agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Rotate), value);
j["rotate"] = value; j["rotate"] = value;
value = ""; value = "";
agent->track_get_property("Scale", value); agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Scale), value);
j["scale"] = value; j["scale"] = value;
value = ""; value = "";
agent->track_get_property("Lay on face", value); agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Flatten), value);
j["flatten"] = value; j["flatten"] = value;
value = ""; value = "";
agent->track_get_property("Support Painting", value); agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::FdmSupports), value);
j["custom_support"] = value; j["custom_support"] = value;
value = ""; value = "";
agent->track_get_property("Seam painting", value); agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Seam), value);
j["custom_seam"] = value; j["custom_seam"] = value;
value = ""; value = "";
agent->track_get_property("Text shape", value); agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Text), value);
j["text_shape"] = value; j["text_shape"] = value;
value = ""; value = "";
agent->track_get_property("custom_painting", value); agent->track_get_property("custom_painting", value);