mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-21 04:23:15 +08:00
FIX: brim gizmo closes the program without prompting dialog
jira: STUDIO-8383 Change-Id: I7e83d19768be754ef79f0063d76624358bba5102
This commit is contained in:
parent
cb5c382f6b
commit
fe5ebf0614
@ -992,7 +992,7 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->enum_values.emplace_back("no_brim");
|
def->enum_values.emplace_back("no_brim");
|
||||||
|
|
||||||
def->enum_labels.emplace_back(L("Auto"));
|
def->enum_labels.emplace_back(L("Auto"));
|
||||||
def->enum_labels.emplace_back(L("Manual"));
|
def->enum_labels.emplace_back(L("Painted"));
|
||||||
def->enum_labels.emplace_back(L("Outer brim only"));
|
def->enum_labels.emplace_back(L("Outer brim only"));
|
||||||
#if 1 //!BBL_RELEASE_TO_PUBLIC
|
#if 1 //!BBL_RELEASE_TO_PUBLIC
|
||||||
// BBS: The following two types are disabled
|
// BBS: The following two types are disabled
|
||||||
|
@ -627,12 +627,10 @@ void GLGizmoBrimEars::on_render_input_window(float x, float y, float bottom_limi
|
|||||||
ImColor HyperColor = ImColor(48, 221, 114, 255).Value;
|
ImColor HyperColor = ImColor(48, 221, 114, 255).Value;
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGuiWrapper::to_ImVec4(ColorRGB::WARNING()));
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGuiWrapper::to_ImVec4(ColorRGB::WARNING()));
|
||||||
float parent_width = ImGui::GetContentRegionAvail().x;
|
float parent_width = ImGui::GetContentRegionAvail().x;
|
||||||
m_imgui->text(_L("Warning: The brim type is not set to manual,"));
|
m_imgui->text_wrapped(_L("Warning: The brim type is not set to \"painted\",the brim ears will not take effect !"), parent_width);
|
||||||
m_imgui->text(_L("the brim ears will not take effect !"));
|
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value);
|
ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value);
|
||||||
m_imgui->text(_L("(set)"));
|
m_imgui->text(_L("(Set the brim type to \"painted\")"));
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
if (ImGui::IsMouseHoveringRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true)) {
|
if (ImGui::IsMouseHoveringRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true)) {
|
||||||
// underline
|
// underline
|
||||||
@ -730,6 +728,16 @@ CommonGizmosDataID GLGizmoBrimEars::on_get_requirements() const
|
|||||||
int(CommonGizmosDataID::ObjectClipper));
|
int(CommonGizmosDataID::ObjectClipper));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLGizmoBrimEars::save_model()
|
||||||
|
{
|
||||||
|
ModelObject* mo = m_c->selection_info()->model_object();
|
||||||
|
if (mo) {
|
||||||
|
mo->brim_points.clear();
|
||||||
|
for (const CacheEntry& ce : m_editing_cache) mo->brim_points.emplace_back(ce.brim_point);
|
||||||
|
wxGetApp().plater()->set_plater_dirty(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// switch gizmos
|
// switch gizmos
|
||||||
void GLGizmoBrimEars::on_set_state()
|
void GLGizmoBrimEars::on_set_state()
|
||||||
{
|
{
|
||||||
@ -744,12 +752,7 @@ void GLGizmoBrimEars::on_set_state()
|
|||||||
if (m_state == Off && m_old_state != Off) {
|
if (m_state == Off && m_old_state != Off) {
|
||||||
// the gizmo was just turned Off
|
// the gizmo was just turned Off
|
||||||
Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Brim ears edit");
|
Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Brim ears edit");
|
||||||
ModelObject *mo = m_c->selection_info()->model_object();
|
save_model();
|
||||||
if (mo) {
|
|
||||||
mo->brim_points.clear();
|
|
||||||
for (const CacheEntry& ce : m_editing_cache) mo->brim_points.emplace_back(ce.brim_point);
|
|
||||||
wxGetApp().plater()->set_plater_dirty(true);
|
|
||||||
}
|
|
||||||
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS));
|
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS));
|
||||||
wxGetApp().plater()->leave_gizmos_stack();
|
wxGetApp().plater()->leave_gizmos_stack();
|
||||||
// wxGetApp().mainframe->update_slice_print_status(MainFrame::SlicePrintEventType::eEventSliceUpdate, true, true);
|
// wxGetApp().mainframe->update_slice_print_status(MainFrame::SlicePrintEventType::eEventSliceUpdate, true, true);
|
||||||
|
@ -78,6 +78,7 @@ public:
|
|||||||
void set_brim_data(ModelObject* model_object, const Selection& selection);
|
void set_brim_data(ModelObject* model_object, const Selection& selection);
|
||||||
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position, bool shift_down, bool alt_down, bool control_down);
|
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position, bool shift_down, bool alt_down, bool control_down);
|
||||||
void delete_selected_points();
|
void delete_selected_points();
|
||||||
|
void save_model();
|
||||||
//ClippingPlane get_sla_clipping_plane() const;
|
//ClippingPlane get_sla_clipping_plane() const;
|
||||||
|
|
||||||
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
||||||
|
@ -1946,7 +1946,8 @@ bool GLGizmosManager::is_in_editing_mode(bool error_notification) const
|
|||||||
if (m_current == SlaSupports && dynamic_cast<GLGizmoSlaSupports*>(get_current())->is_in_editing_mode()) {
|
if (m_current == SlaSupports && dynamic_cast<GLGizmoSlaSupports*>(get_current())->is_in_editing_mode()) {
|
||||||
return true;
|
return true;
|
||||||
} else if (m_current == BrimEars) {
|
} else if (m_current == BrimEars) {
|
||||||
return true;
|
dynamic_cast<GLGizmoBrimEars*>(get_current())->save_model();
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user