From d163cea8f81a05fad28916eeb4a55ec11580a41f Mon Sep 17 00:00:00 2001 From: yw4z Date: Mon, 22 Apr 2024 16:37:04 +0300 Subject: [PATCH] Fix crash when changing type of SVG / TEXT modifier (#5070) * Fix crash when changing type of SVG / TEXT modifier --- src/slic3r/GUI/GUI_ObjectList.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index d3907983819..25a18d2c6a5 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -5025,8 +5025,17 @@ void ObjectList::change_part_type() } } - const wxString names[] = { _L("Part"), _L("Negative Part"), _L("Modifier"), _L("Support Blocker"), _L("Support Enforcer") }; - SingleChoiceDialog dlg(_L("Type:"), _L("Choose part type"), wxArrayString(5, names), int(type)); + // ORCA: Fix crash when changing type of svg / text modifier + wxArrayString names; + names.Add(_L("Part")); + names.Add(_L("Negative Part")); + names.Add(_L("Modifier")); + if (!volume->is_svg() && !volume->is_text()) { + names.Add(_L("Support Blocker")); + names.Add(_L("Support Enforcer")); + } + + SingleChoiceDialog dlg(_L("Type:"), _L("Choose part type"), names, int(type)); auto new_type = ModelVolumeType(dlg.GetSingleChoiceIndex()); if (new_type == type || new_type == ModelVolumeType::INVALID)