Skip to content

Commit

Permalink
FIX:Fix bugs caused by buried points
Browse files Browse the repository at this point in the history
Change-Id: I47d4e786912120124c134404afce15dec48c7974
Signed-off-by: Kunlong Ma <kunlong.ma@bambulab.com>
  • Loading branch information
MklBambu authored and lanewei120 committed Aug 1, 2023
1 parent 80fb7c6 commit fcb7db2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
39 changes: 31 additions & 8 deletions src/slic3r/GUI/Gizmos/GLGizmosManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,16 +982,16 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt)
update_on_off_state(mouse_pos);
update_data();
m_parent.set_as_dirty();
}
try {
std::string name = m_gizmos[m_hover]->get_gizmo_name();
int count = m_gizmos[m_hover]->get_count();
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) {
agent->track_update_property(name, std::to_string(count));
try {
std::string name = get_name_from_gizmo_etype(m_hover);
int count = m_gizmos[m_hover]->get_count();
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) {
agent->track_update_property(name, std::to_string(count));
}
}
catch (...) {}
}
catch (...) {}
}
else if (evt.MiddleDown()) {
m_mouse_capture.middle = true;
Expand Down Expand Up @@ -1685,5 +1685,28 @@ int GLGizmosManager::get_shortcut_key(GLGizmosManager::EType type) const
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 Slic3r
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Gizmos/GLGizmosManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class GLGizmosManager : public Slic3r::ObjectBase
bool grabber_contains_mouse() const;
};


std::string get_name_from_gizmo_etype(GLGizmosManager::EType type);

} // namespace GUI
} // namespace Slic3r
Expand Down
14 changes: 7 additions & 7 deletions src/slic3r/GUI/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,25 +491,25 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
j["custom_height"] = value;
value = "";

agent->track_get_property("Move", value);
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Move), value);
j["move"] = value;
value = "";
agent->track_get_property("Rotate", value);
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Rotate), value);
j["rotate"] = value;
value = "";
agent->track_get_property("Scale", value);
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Scale), value);
j["scale"] = 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;
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;
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;
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;
value = "";
agent->track_get_property("custom_painting", value);
Expand Down

0 comments on commit fcb7db2

Please sign in to comment.